diff --git a/share/functions/__fish_apropos.fish b/share/functions/__fish_apropos.fish index 5bf44f1d7..daca18c74 100644 --- a/share/functions/__fish_apropos.fish +++ b/share/functions/__fish_apropos.fish @@ -9,7 +9,7 @@ end set -l sysver (uname -sr | string match -r "(Darwin) (\d\d)"\.) if test $status -eq 0 -a (count $sysver) -eq 3 - and test $sysver[2] = 'Darwin' -a $sysver[3] -ge 19 + and test $sysver[2] = Darwin -a $sysver[3] -ge 19 set -l dir if test -n "$XDG_CACHE_HOME" diff --git a/share/functions/__fish_argcomplete_complete.fish b/share/functions/__fish_argcomplete_complete.fish index 8d4cdf6bf..0986b6427 100644 --- a/share/functions/__fish_argcomplete_complete.fish +++ b/share/functions/__fish_argcomplete_complete.fish @@ -1,10 +1,10 @@ function __fish_argcomplete_complete - set -lx _ARGCOMPLETE 1 - set -lx _ARGCOMPLETE_IFS \n - set -lx _ARGCOMPLETE_SUPPRESS_SPACE 1 - set -lx _ARGCOMPLETE_SHELL fish - set -lx COMP_LINE (commandline -pc) - set -lx COMP_POINT (string length (commandline -cp)) - set -lx COMP_TYPE - $argv 8>&1 9>&2 2>/dev/null + set -lx _ARGCOMPLETE 1 + set -lx _ARGCOMPLETE_IFS \n + set -lx _ARGCOMPLETE_SUPPRESS_SPACE 1 + set -lx _ARGCOMPLETE_SHELL fish + set -lx COMP_LINE (commandline -pc) + set -lx COMP_POINT (string length (commandline -cp)) + set -lx COMP_TYPE + $argv 8>&1 9>&2 2>/dev/null end diff --git a/share/functions/__fish_is_token_n.fish b/share/functions/__fish_is_token_n.fish index a8fddce53..7e3deb51d 100644 --- a/share/functions/__fish_is_token_n.fish +++ b/share/functions/__fish_is_token_n.fish @@ -1,5 +1,3 @@ function __fish_is_token_n --description 'Test if current token is on Nth place' --argument-names n fish_is_nth_token $n end - - diff --git a/share/functions/__fish_make_completion_signals.fish b/share/functions/__fish_make_completion_signals.fish index e6c0d2bd9..fe4002bb1 100644 --- a/share/functions/__fish_make_completion_signals.fish +++ b/share/functions/__fish_make_completion_signals.fish @@ -8,7 +8,7 @@ function __fish_make_completion_signals --description 'Make list of kill signals # Just hardcode the signals. set -l os (uname) if string match -q 'CYGWIN*' -- $os - or string match -iq 'Msys' -- $os + or string match -iq Msys -- $os set -a __kill_signals "1 HUP" "2 INT" "3 QUIT" "4 ILL" "5 TRAP" "6 ABRT" \ "6 IOT" "7 BUS" "8 FPE" "9 KILL" "10 USR1" "11 SEGV" \ "12 USR2" "13 PIPE" "14 ALRM" "15 TERM" "16 STKFLT" "17 CHLD" \ diff --git a/share/functions/fish_command_not_found.fish b/share/functions/fish_command_not_found.fish index 8891f4326..83c854c51 100644 --- a/share/functions/fish_command_not_found.fish +++ b/share/functions/fish_command_not_found.fish @@ -61,18 +61,18 @@ else if type -q pkgfile __fish_default_command_not_found_handler $argv[1] end end -# pacman is too slow, see #7841. -# else if type -q pacman -# function fish_command_not_found -# set -l paths $argv[1] -# # If we've not been given an absolute path, try $PATH as the starting point, -# # otherwise pacman will try *every path*, and e.g. bash-completion -# # isn't helpful. -# string match -q '/*' -- $argv[1]; or set paths $PATH/$argv[1] -# # Pacman only prints the path, so we still need to print the error. -# __fish_default_command_not_found_handler $argv[1] -# pacman -F $paths -# end + # pacman is too slow, see #7841. + # else if type -q pacman + # function fish_command_not_found + # set -l paths $argv[1] + # # If we've not been given an absolute path, try $PATH as the starting point, + # # otherwise pacman will try *every path*, and e.g. bash-completion + # # isn't helpful. + # string match -q '/*' -- $argv[1]; or set paths $PATH/$argv[1] + # # Pacman only prints the path, so we still need to print the error. + # __fish_default_command_not_found_handler $argv[1] + # pacman -F $paths + # end else # Use standard fish command not found handler otherwise function fish_command_not_found --on-event fish_command_not_found diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index 4b671a808..113bd73c6 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -36,7 +36,7 @@ function fish_config --description "Launch fish's web based configuration" echo No such subcommand: $cmd >&2 return 1 end - + switch $cmd case prompt # prompt - for prompt switching @@ -67,7 +67,7 @@ function fish_config --description "Launch fish's web based configuration" if functions -q fish_right_prompt; echo right prompt: (false; fish_right_prompt) end' $p - echo + echo end case list '' string replace -r '.*/([^/]*).fish$' '$1' $prompt_dir/*.fish @@ -248,7 +248,7 @@ function fish_config --description "Launch fish's web based configuration" # permanently remove the globals. set $scope $toks set have_color 1 - end < $file + end <$file # Return true if we changed at least one color test $have_color -eq 1 diff --git a/share/functions/prompt_login.fish b/share/functions/prompt_login.fish index 0aaa4544b..eeafcbb6f 100644 --- a/share/functions/prompt_login.fish +++ b/share/functions/prompt_login.fish @@ -3,7 +3,7 @@ function prompt_login --description "Print a description of the user and host su set -g __fish_machine set -l debian_chroot $debian_chroot - if test -r /etc/debian_chroot + if test -r /etc/debian_chroot set debian_chroot (cat /etc/debian_chroot) end