diff --git a/share/functions/__fish_toggle_comment_commandline.fish b/share/functions/__fish_toggle_comment_commandline.fish index 33360bf05..35ba44797 100644 --- a/share/functions/__fish_toggle_comment_commandline.fish +++ b/share/functions/__fish_toggle_comment_commandline.fish @@ -9,7 +9,7 @@ function __fish_toggle_comment_commandline --description 'Comment/uncomment the current command' set -l cmdlines (commandline -b) - if test "$cmdlines" = "" + if test -z "$cmdlines" set cmdlines (history search -p "#" --max=1) end set -l cmdlines (printf '%s\n' '#'$cmdlines | string replace -r '^##' '')