mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03:00
Fix funced to stop outputing an error if no EDITOR is set
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user