mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-19 05:13:44 +08:00
29f35d6cdf
This gives us more accurate completions because completion scripts get expanded paths
6 lines
285 B
Fish
6 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
|