diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-01-27 13:14:24 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-01-27 13:14:24 -0800 |
commit | 27e71c5f378a1484698488aa189b8b36d09c2a4e (patch) | |
tree | df2dc0cc292bc80e8219ae25b01dbb3dcc1b2238 /share/functions/funced.fish | |
parent | cddf7e09869a7e7b00dd7913f8562c3d758acfb2 (diff) |
Fix funced to stop outputing an error if no EDITOR is set
Diffstat (limited to 'share/functions/funced.fish')
-rw-r--r-- | share/functions/funced.fish | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/share/functions/funced.fish b/share/functions/funced.fish index 9710c1f8..acee5c1a 100644 --- a/share/functions/funced.fish +++ b/share/functions/funced.fish @@ -48,12 +48,19 @@ function funced --description 'Edit function definition' end # 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 + if test -n "$editor" + 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 editor fish + end + end + + # If no editor is specified, use fish + if test -z "$editor" + set editor fish end if begin; set -q interactive[1]; or test "$editor" = fish; end |