about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-27 09:12:33 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-27 09:12:33 +0000
commit6f2112f23a4838fd1c52efd16c844142f5407394 (patch)
tree5b09e20b8a7acb079393480fe739e8b7add03942 /Completion
parenta509b259f889404b3c821a19243ebde19d582aaf (diff)
downloadzsh-6f2112f23a4838fd1c52efd16c844142f5407394.tar.gz
zsh-6f2112f23a4838fd1c52efd16c844142f5407394.tar.xz
zsh-6f2112f23a4838fd1c52efd16c844142f5407394.zip
try to improve testing for suffix style in _expand; make _path_files fail to complete words like ...<pat>..<param-subst>... (14133)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Completer/_expand7
-rw-r--r--Completion/Unix/Type/_path_files2
2 files changed, 7 insertions, 2 deletions
diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
index 8fcedea96..f3da119e1 100644
--- a/Completion/Base/Completer/_expand
+++ b/Completion/Base/Completer/_expand
@@ -28,8 +28,13 @@ fi
    ( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] &&
     return 1
 
+### I'm not sure about the pattern to use in the following test.
+# It once was:
+#  [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
+
 zstyle -T ":completion:${curcontext}:" suffix &&
-  [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
+  [[ "$word" = (\~*/|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
+     "${(e)word}" != *[][^~*?\<\>\{\}\|]* ]] &&
   return 1
 
 zstyle -t ":completion:${curcontext}:" accept-exact ||
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index ffaf0d77f..6a30cf2b8 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -190,7 +190,7 @@ eorig="$orig"
 
 # Now let's have a closer look at the string to complete.
 
-if [[ "$pre" = *(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then
+if [[ "$pre" = [^][*?#^\|\<\>]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then
 
   # If there is a parameter expansion in the word from the line, we try
   # to complete the beast by expanding the prefix and completing anything