about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-08 09:36:40 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-08 09:36:40 +0000
commit5fc256c9876a36bc7d9c7c30261249e9ea189253 (patch)
tree9ecb69c35f5d78a8dd75d4c706a15e79bb425ee4
parent1bd39e36abcac8b775125c1e06b0d789eb62ec08 (diff)
downloadzsh-5fc256c9876a36bc7d9c7c30261249e9ea189253.tar.gz
zsh-5fc256c9876a36bc7d9c7c30261249e9ea189253.tar.xz
zsh-5fc256c9876a36bc7d9c7c30261249e9ea189253.zip
zsh-workers/7716
-rw-r--r--Completion/Base/_precommand3
-rw-r--r--Completion/Core/_complete2
-rw-r--r--Completion/Core/_normal7
3 files changed, 8 insertions, 4 deletions
diff --git a/Completion/Base/_precommand b/Completion/Base/_precommand
index 1ff11bc3c..bcda9fc8b 100644
--- a/Completion/Base/_precommand
+++ b/Completion/Base/_precommand
@@ -3,7 +3,4 @@
 shift words
 (( CURRENT-- ))
 
-# We now want to go back to doing ordinary completion on the new word,
-# so restore the default _compskip.
-_compskip=''
 _normal
diff --git a/Completion/Core/_complete b/Completion/Core/_complete
index 9b6311100..6affdba2a 100644
--- a/Completion/Core/_complete
+++ b/Completion/Core/_complete
@@ -31,7 +31,7 @@ fi
 # For arguments and command names we use the `_normal' function.
 
 if [[ "$compstate[context]" = command ]]; then
-  _normal
+  _normal -s
 else
   # Let's see if we have a special completion definition for the other
   # possible contexts.
diff --git a/Completion/Core/_normal b/Completion/Core/_normal
index 2b53e0b02..e8b5fc146 100644
--- a/Completion/Core/_normal
+++ b/Completion/Core/_normal
@@ -2,6 +2,13 @@
 
 local comp command cmd1 cmd2 pat val name i ret=1 _compskip="$_compskip"
 
+# If we get the option `-s', we don't reset `_compskip'. This ensures
+# that a value set in the function for the `-first-' context is kept,
+# but that we still use pattern functions when we were called form
+# another completion function.
+
+[[ "$1" = -s ]] || _compskip=''
+
 # Completing in command position? If not we set up `cmd1' and `cmd2' as
 # two strings we have to search in the completion definition arrays (e.g.
 # a path and the last path name component).