diff --git a/share/functions/funced.fish b/share/functions/funced.fish index d5880fd08..9710c1f8b 100644 --- a/share/functions/funced.fish +++ b/share/functions/funced.fish @@ -47,7 +47,12 @@ function funced --description 'Edit function definition' set init function $funcname\n\nend end - if not type -f "$editor[1]" >/dev/null + # Break editor up to get its first command (i.e. discard flags) + set -l editor_cmd + eval set editor_cmd $editor + 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 end