mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Fix funced to stop outputing an error if no EDITOR is set
This commit is contained in:
parent
cddf7e0986
commit
27e71c5f37
1 changed files with 13 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue