mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 09:20:10 +08:00
Let funced handle empty $EDITOR
For some weird reason we only used $editor if it wasn't empty, but then failed to fail if it was. This will now print an error and use fish, just like if the $EDITOR value is invalid in any other way. Fixes #5257.
This commit is contained in:
parent
c140b3c724
commit
d22446f651
|
@ -46,13 +46,11 @@ function funced --description 'Edit function definition'
|
|||
end
|
||||
|
||||
# Break editor up to get its first command (i.e. discard flags)
|
||||
if test -n "$editor"
|
||||
set -l editor_cmd
|
||||
eval set editor_cmd $editor
|
||||
if not type -q -f "$editor_cmd[1]"
|
||||
echo (_ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor_cmd[1]' could not be found")
|
||||
set editor fish
|
||||
end
|
||||
set -l editor_cmd
|
||||
eval set editor_cmd $editor
|
||||
if not type -q -f "$editor_cmd[1]"
|
||||
echo (_ "funced: The value for \$EDITOR '$editor' could not be used because the command '$editor_cmd[1]' could not be found")
|
||||
set editor fish
|
||||
end
|
||||
|
||||
if test "$editor" = fish
|
||||
|
|
Loading…
Reference in New Issue
Block a user