From b0fde52d53c039af943336268e9e2b2d485fac0f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 16 Mar 2009 18:29:38 +0000 Subject: 26744: completion of history modifiers in normal command line arguments --- ChangeLog | 7 ++++++- Completion/Base/Core/_normal | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index db1acb35e..7095336d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-16 Peter Stephenson + + * 26744: Completion/Zsh/Context/_normal: handle completion + of history modifiers for normal command line arguments. + 2009-03-15 Barton E. Schaefer * 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 -- cgit 1.4.1