Undunder __fish_is_nth_token

We keep __fish_is_nth_token for compatibility and edit the
implementations of __fish_is_nth_token, __fish_is_first_token and
__fish_is_token_n to use fish_is_nth_token
This commit is contained in:
Aniruddh Agarwal
2021-06-29 20:26:49 -04:00
committed by Fabian Homborg
parent 859edc9c2c
commit 0445126c2e
35 changed files with 172 additions and 181 deletions

View File

@@ -1,6 +1,3 @@
function __fish_is_nth_token
set -l n $argv[1]
set -l tokens (commandline -poc)
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
test (count $tokens) -eq "$n"
function __fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n
fish_is_nth_token $n
end