Skip to content

Commit 5762d5e

Browse files
authored
fix: autocomplete from subfolder works as expected in zsh shell (#2425)
1 parent 9f2fe0d commit 5762d5e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

completion/zsh/_task

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,18 @@ function __task_list() {
1616

1717

1818
if [[ -n "$taskfile" && -f "$taskfile" ]]; then
19-
enabled=1
2019
cmd+=(--taskfile "$taskfile")
21-
else
22-
for taskfile in {T,t}askfile{,.dist}.{yaml,yml}; do
23-
if [[ -f "$taskfile" ]]; then
24-
enabled=1
25-
break
26-
fi
27-
done
20+
fi
21+
22+
23+
if output=$("${cmd[@]}" $_GO_TASK_COMPLETION_LIST_OPTION 2>/dev/null); then
24+
enabled=1
2825
fi
2926

3027
(( enabled )) || return 0
3128

3229
scripts=()
33-
for item in "${(@)${(f)$("${cmd[@]}" $_GO_TASK_COMPLETION_LIST_OPTION)}[2,-1]#\* }"; do
30+
for item in "${(@)${(f)output}[2,-1]#\* }"; do
3431
task="${item%%:[[:space:]]*}"
3532
desc="${item##[^[:space:]]##[[:space:]]##}"
3633
scripts+=( "${task//:/\\:}:$desc" )

0 commit comments

Comments
 (0)