Return early if token is empty in whatis_current_token

This commit is contained in:
Gokul Soumya 2020-07-12 00:49:37 +05:30 committed by Johannes Altmanninger
parent 5f782cef7d
commit ec0c3f349d

View File

@ -3,7 +3,9 @@
function __fish_whatis_current_token -d "Show man page entries or function description related to the token under the cursor" function __fish_whatis_current_token -d "Show man page entries or function description related to the token under the cursor"
set -l token (commandline -pt) set -l token (commandline -pt)
if test -n "$token" test -n "$token"
or return
printf "\n" printf "\n"
set -l desc "$token: nothing appropriate." set -l desc "$token: nothing appropriate."
@ -38,4 +40,3 @@ function __fish_whatis_current_token -d "Show man page entries or function descr
commandline -f repaint commandline -f repaint
end end
end