summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Base/Core/_normal13
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index db1acb35e..7095336d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-16 Peter Stephenson <pws@csr.com>
+
+ * 26744: Completion/Zsh/Context/_normal: handle completion
+ of history modifiers for normal command line arguments.
+
2009-03-15 Barton E. Schaefer <schaefer@zsh.org>
* users/13937, users/13939: configure.ac, Src/jobs.c: check for
@@ -11421,5 +11426,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4619 $
+* $Revision: 1.4620 $
*****************************************************
diff --git a/Completion/Base/Core/_normal b/Completion/Base/Core/_normal
index 36ecb225d..6bdb8f09b 100644
--- a/Completion/Base/Core/_normal
+++ b/Completion/Base/Core/_normal
@@ -9,6 +9,19 @@ else
_compskip=''
fi
+# Check for a history reference to complete modifiers.
+# $PREFIX has a quoted form of the !, so we can't test that
+# (it might the start of a real argument), but words has the
+# raw McCoy.
+if [[ -o BANG_HIST && $words[CURRENT] = \!*: && -z $compstate[quote] ]]; then
+ # This looks like a real history expansion; in that case
+ # we'd better put the !'s back the way pfalstad intended.
+ PREFIX=${PREFIX//\\!/!}
+ compset -P '*:'
+ _history_modifiers h
+ return
+fi
+
# Completing in command position?
if [[ CURRENT -eq 1 ]]; then