Skip to content

Commit f45fc77

Browse files
committed
fix(function): remove extra space for non-existing functions
1 parent c343c46 commit f45fc77

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

completions/function

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ _function()
88
if ((cword == 1)); then
99
COMPREPLY=($(compgen -A function -- "$cur"))
1010
else
11-
COMPREPLY=("() $(type -- "${words[1]}" 2>/dev/null | command sed -e 1,2d)")
11+
local funcdef=$(type -- "${words[1]}" 2>/dev/null | command sed -e 1,2d)
12+
COMPREPLY=("()${funcdef:+ $funcdef}")
1213
fi
1314
} &&
1415
complete -F _function function

0 commit comments

Comments
 (0)