aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/funced.fish
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-01-23 17:14:22 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-01-23 17:14:22 -0800
commitdebfc0f712c061e92894afbe47fe5691374e3e2d (patch)
tree01714181772bf1ba0fd50df8873d16b2d4ba88c1 /share/functions/funced.fish
parent3d0d9a250bbbff15cfae6900772279bb96adb062 (diff)
Allow $EDITOR to be an array. Fixes https://github.com/fish-shell/fish-shell/issues/541
Diffstat (limited to 'share/functions/funced.fish')
-rw-r--r--share/functions/funced.fish32
1 files changed, 16 insertions, 16 deletions
diff --git a/share/functions/funced.fish b/share/functions/funced.fish
index 399439fd..d5880fd0 100644
--- a/share/functions/funced.fish
+++ b/share/functions/funced.fish
@@ -1,32 +1,32 @@
function funced --description 'Edit function definition'
- set -l editor $EDITOR
+ set -l editor $EDITOR
set -l interactive
set -l funcname
while set -q argv[1]
switch $argv[1]
- case -h --help
- __fish_print_help funced
- return 0
+ case -h --help
+ __fish_print_help funced
+ return 0
case -e --editor
- set editor $argv[2]
- set -e argv[2]
+ set editor $argv[2]
+ set -e argv[2]
case -i --interactive
- set interactive 1
+ set interactive 1
case --
- set funcname $funcname $argv[2]
- set -e argv[2]
+ set funcname $funcname $argv[2]
+ set -e argv[2]
- case '-*'
- set_color red
- printf (_ "%s: Unknown option %s\n") funced $argv[1]
- set_color normal
- return 1
+ case '-*'
+ set_color red
+ printf (_ "%s: Unknown option %s\n") funced $argv[1]
+ set_color normal
+ return 1
case '*' '.*'
- set funcname $funcname $argv[1]
+ set funcname $funcname $argv[1]
end
set -e argv[1]
end
@@ -47,7 +47,7 @@ function funced --description 'Edit function definition'
set init function $funcname\n\nend
end
- if not type -f "$editor" >/dev/null
+ if not type -f "$editor[1]" >/dev/null
set interactive 1
end