Skip to content

Commit 0d1d7d7

Browse files
committed
Update complete.zsh
1 parent af0c0ac commit 0d1d7d7

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

internal/complete/complete.zsh

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
_fx_complete() {
2-
local reply
3-
reply=("${(@f)$(COMP_ZSH="${LBUFFER}" fx)}")
4-
if (( ${#reply} )); then
5-
local -a insert display
6-
for line in "${reply[@]}"; do
7-
display+=("${line%%$'\t'*}")
8-
insert+=("${line#*$'\t'}")
9-
done
10-
compadd -f -S '' -d display -a insert
11-
fi
1+
#compdef fx
2+
3+
_fx() {
4+
local reply
5+
reply=("${(@f)$(COMP_ZSH="${LBUFFER}" fx)}")
6+
if (( ${#reply} )); then
7+
local -a insert display
8+
for line in "${reply[@]}"; do
9+
display+=("${line%%$'\t'*}")
10+
insert+=("${line#*$'\t'}")
11+
done
12+
compadd -f -S '' -d display -a insert
13+
fi
1214
}
1315

14-
compdef _fx_complete fx
16+
if [ "$funcstack[1]" = "_fx" ]; then
17+
_fx "$@"
18+
else
19+
compdef _fx fx
20+
fi

0 commit comments

Comments
 (0)