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 --- Completion/Base/Core/_normal | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Completion/Base') 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