mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 14:23:09 +00:00
29f35d6cdf
This gives us more accurate completions because completion scripts get expanded paths
5 lines
285 B
Fish
5 lines
285 B
Fish
function __fish_is_nth_token --description 'Test if current token is the Nth (ignoring command and switches/flags)' --argument-names n
|
|
set -l tokens (commandline -pxc)
|
|
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
|
|
test (count $tokens) -eq "$n"
|
|
end
|