From aa7e584ee80ca8a7107c7af59fd827a399ac93cd Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 10 Nov 2007 14:30:22 +0000 Subject: Mikael Magnusson, 24076; 24081: cancel argument processing after widget calls with general arguments --- ChangeLog | 8 ++++++++ Doc/Zsh/zle.yo | 4 +++- Functions/Zle/backward-kill-word-match | 2 +- Functions/Zle/delete-whole-word-match | 4 ++-- Functions/Zle/kill-word-match | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a3502f92..e2dd2b900 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-11-10 Peter Stephenson + + * Mikael Magnusson, 24076; 24081: Doc/Zsh/zle.yo, + Functions/Zle/backward-kill-word-match, + Functions/Zle/delete-whole-word-match, + Functions/Zle/kill-word-match: need to cancel option + processing with -- after widget calls with arguments. + 2007-11-09 Wayne Davison * unposted: Completion/Unix/Command/_rsync: Added missing diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index cafb96e90..db4becd74 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -554,7 +554,9 @@ appears as if the top-level widget called by the user were still active. With the option tt(-w), tt(WIDGET) and related parameters are set to reflect the widget being executed by the tt(zle) call. -Any further arguments will be passed to the widget. If it is a shell +Any further arguments will be passed to the widget; note that as +standard argument handling is performed, any general argument list +should be preceded by tt(-)tt(-). If it is a shell function, these are passed down as positional parameters; for builtin widgets it is up to the widget in question what it does with them. Currently arguments are only handled by the incremental-search commands, diff --git a/Functions/Zle/backward-kill-word-match b/Functions/Zle/backward-kill-word-match index 28f7e76ee..ded4db2b5 100644 --- a/Functions/Zle/backward-kill-word-match +++ b/Functions/Zle/backward-kill-word-match @@ -23,7 +23,7 @@ while (( count-- )); do if [[ -n $done || $LASTWIDGET = *kill* ]]; then CUTBUFFER="$word$CUTBUFFER" else - zle copy-region-as-kill "$word" + zle copy-region-as-kill -- "$word" fi LBUFFER=$matched_words[1] else diff --git a/Functions/Zle/delete-whole-word-match b/Functions/Zle/delete-whole-word-match index 978b95ee7..6f1ba6697 100644 --- a/Functions/Zle/delete-whole-word-match +++ b/Functions/Zle/delete-whole-word-match @@ -9,7 +9,7 @@ # saved for future yanking in the normal way. emulate -L zsh -setopt extendedglob +setopt extendedglob xtrace local curcontext=:zle:$WIDGET local -a matched_words @@ -49,7 +49,7 @@ if [[ $WIDGET = *kill* ]]; then if [[ $LASTWIDGET = *kill* ]]; then CUTBUFFER="$CUTBUFFER$word" else - zle copy-region-as-kill "$word" + zle copy-region-as-kill -- "$word" fi fi BUFFER="${BUFFER[1,pos1]}${BUFFER[pos2,-1]}" diff --git a/Functions/Zle/kill-word-match b/Functions/Zle/kill-word-match index 55e253dea..5fcaeb86c 100644 --- a/Functions/Zle/kill-word-match +++ b/Functions/Zle/kill-word-match @@ -22,7 +22,7 @@ while (( count-- )); do if [[ -n $done || $LASTWIDGET = *kill* ]]; then CUTBUFFER="$CUTBUFFER$word" else - zle copy-region-as-kill $word + zle copy-region-as-kill -- $word fi RBUFFER=${(j..)matched_words[6,7]} else -- cgit 1.4.1