From bcd865f7d2f09fb42c755f0ad7f26f7ed26a60f0 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 5 Apr 2000 08:24:59 +0000 Subject: fix for combining _next_tags and file-patterns --- Completion/Commands/_next_tags | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/Commands/_next_tags b/Completion/Commands/_next_tags index 867cf0b98..d9a5f08d8 100644 --- a/Completion/Commands/_next_tags +++ b/Completion/Commands/_next_tags @@ -92,12 +92,20 @@ _next_tags_sort() { if [[ -z "$nodef" ]]; then if [[ $funcstack[4] = _files ]]; then if zstyle -a ":completion:${curcontext}:" file-patterns tmp; then - [[ "$argv" = *${${tmp[-1]##[^\\]:}%:*}* ]] && _next_tags_reset=yes + [[ "$argv" = *${${tmp[-1]#*[^\\]:}%:*}* ]] && _next_tags_reset=yes else [[ "$argv" = *all-files* ]] && _next_tags_reset=yes fi fi - comptry "${(@)argv:#(${(j:|:)~${=_next_tags_not}})(|:*)}" + tmp=( "${(@)argv:#(${(j:|:)~${=_next_tags_not}})(|:*)}" ) + + # $prev is set in _tags! + + if [[ -n "$prev" && ( $#tmp -ne 0 || $funcstack[4] = _files ) ]]; then + comptry "$tmp[@]" + else + comptry "$argv[@]" + fi fi } -- cgit 1.4.1