Skip to content

Commit

Permalink
Use $VISUAL before $EDITOR in funced
Browse files Browse the repository at this point in the history
  • Loading branch information
faho committed Sep 8, 2015
1 parent 172a052 commit 793aed0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc_src/funced.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ funced [OPTIONS] NAME

`funced` provides an interface to edit the definition of the function `NAME`.

If the `$EDITOR` environment variable is set, it will be used as the program to edit the function. Otherwise, a built-in editor will be used.
If the `$VISUAL` environment variable is set, it will be used as the program to edit the function. If `$VISUAL` is unset but `$EDITOR` is set, that will be used. Otherwise, a built-in editor will be used.

If there is no function called `NAME` a new function will be created with the specified name

Expand Down
8 changes: 7 additions & 1 deletion share/functions/funced.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
function funced --description 'Edit function definition'
set -l editor $EDITOR
set -l editor
# Check VISUAL first since theoretically EDITOR could be ed
if set -q VISUAL
set editor $VISUAL
else if set -q EDITOR
set editor $EDITOR
end
set -l interactive
set -l funcname
while set -q argv[1]
Expand Down

0 comments on commit 793aed0

Please sign in to comment.