aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/funced.fish
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-01-23 18:24:49 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-01-23 18:24:49 -0800
commit5e9ca72731856363dc1805c8ee0ebfa68589cb27 (patch)
treeef20ebb50698def0e6e5164d414ba2f2538e4d6d /share/functions/funced.fish
parentdebfc0f712c061e92894afbe47fe5691374e3e2d (diff)
Break up $EDITOR before passing it to type to allow it to contain flags
Diffstat (limited to 'share/functions/funced.fish')
-rw-r--r--share/functions/funced.fish7
1 files changed, 6 insertions, 1 deletions
diff --git a/share/functions/funced.fish b/share/functions/funced.fish
index d5880fd0..9710c1f8 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