about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Type/_files20
2 files changed, 25 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ef6d9155..25bd98f76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-14  Oliver Kiddle  <opk@zsh.org>
+
+	* 35789: (tweaked c.f. Bart: 35791) Completion/Unix/Type/_files:
+	duplicate glob qualifier handling from _path_files so it is
+	called once and not for each file pattern
+
 2015-07-13  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 35790: Util/zyodl.vim: zyodl.vim: Be compatible with Vim 6.
diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files
index e628cb39e..a8ba9b3ce 100644
--- a/Completion/Unix/Type/_files
+++ b/Completion/Unix/Type/_files
@@ -1,6 +1,24 @@
 #compdef -redirect-,-default-,-default-
 
-local opts tmp glob pat pats expl tag i def descr end ign ret=1 match tried
+local -a match mbegin mend
+local ret=1
+
+# Look for glob qualifiers. This is duplicated from _path_files because
+# we don't want to complete them multiple times (for each file pattern).
+if _have_glob_qual $PREFIX; then
+  compset -p ${#match[1]}
+  if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then
+    _globflags && ret=0
+  else
+    if [[ $_comp_caller_options[extendedglob] == on ]]; then
+      _describe -t globflags "glob flag" '(\#:introduce\ glob\ flag)' -Q -S '' && ret=0
+    fi
+    _globquals && ret=0
+  fi
+  return ret
+fi
+
+local opts tmp glob pat pats expl tag i def descr end ign tried
 local type sdef ignvars ignvar prepath oprefix rfiles rfile
 
 zparseopts -a opts \