mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 08:51:14 -03:00
funced: skip indent step if fish_indent not installed
Just in case.
This commit is contained in:
@@ -60,12 +60,16 @@ function funced --description 'Edit function definition'
|
|||||||
|
|
||||||
if test "$editor" = fish
|
if test "$editor" = fish
|
||||||
if functions -q -- $funcname
|
if functions -q -- $funcname
|
||||||
functions --no-details -- $funcname | fish_indent --no-indent | read -z init
|
command -q fish_indent
|
||||||
|
and functions --no-details -- $funcname | fish_indent --no-indent | read -z init
|
||||||
|
or functions --no-details -- $funcname | read -z init
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l prompt 'printf "%s%s%s> " (set_color green) '$funcname' (set_color normal)'
|
set -l prompt 'printf "%s%s%s> " (set_color green) '$funcname' (set_color normal)'
|
||||||
if read -p $prompt -c "$init" --shell cmd
|
if read -p $prompt -c "$init" --shell cmd
|
||||||
echo -n $cmd | fish_indent | read -lz cmd
|
command -q fish_indent
|
||||||
|
and echo -n $cmd | fish_indent | read -lz cmd
|
||||||
|
or echo -n $cmd | read -lz cmd
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
end
|
end
|
||||||
if set -q _flag_save
|
if set -q _flag_save
|
||||||
|
|||||||
Reference in New Issue
Block a user