From d22446f6510a153a8142562f265691cd448940aa Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 15 Oct 2018 10:13:19 +0200 Subject: [PATCH] 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. --- share/functions/funced.fish | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/share/functions/funced.fish b/share/functions/funced.fish index 401b85276..602c7b82e 100644 --- a/share/functions/funced.fish +++ b/share/functions/funced.fish @@ -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