Fix funced to stop outputing an error if no EDITOR is set

This commit is contained in:
ridiculousfish 2013-01-27 13:14:24 -08:00
parent cddf7e0986
commit 27e71c5f37

View file

@ -48,12 +48,19 @@ function funced --description 'Edit function definition'
end end
# Break editor up to get its first command (i.e. discard flags) # Break editor up to get its first command (i.e. discard flags)
set -l editor_cmd if test -n "$editor"
eval set editor_cmd $editor set -l editor_cmd
if not type -f "$editor_cmd[1]" >/dev/null eval set editor_cmd $editor
_ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor_cmd[1]' could not be found if not type -f "$editor_cmd[1]" >/dev/null
" _ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor_cmd[1]' could not be found
set interactive 1 "
set editor fish
end
end
# If no editor is specified, use fish
if test -z "$editor"
set editor fish
end end
if begin; set -q interactive[1]; or test "$editor" = fish; end if begin; set -q interactive[1]; or test "$editor" = fish; end