From 004d0886f1024be64b15fe05c503ee1171fccb4d Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 16 Oct 2006 01:08:15 +0000 Subject: Add an example, as a comment. --- Functions/Zle/keymap+widget | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Functions/Zle') diff --git a/Functions/Zle/keymap+widget b/Functions/Zle/keymap+widget index 2a437c234..c3e70ccbb 100644 --- a/Functions/Zle/keymap+widget +++ b/Functions/Zle/keymap+widget @@ -74,3 +74,22 @@ return 0 # bind the caps-lock widget to it: # # bindkey -M main '^XL' caps-lock + +# Another example of using a continuation widget to propagate accept-line +# (or any other binding from the original keymap) through the caller: +# +# bindkey -N newkeymap $KEYMAP +# recursive-edit-and-accept() { +# local -a __accepted +# zle -N newkeymap+accept-line end-recursive-edit +# zle recursive-edit -K newkeymap || zle send-break +# if [[ ${__accepted[0]} != end-recursive-edit ]] +# then zle "${__accepted[@]}"; return +# else return 0 +# fi +# } +# end-recursive-edit() { +# __accepted=($WIDGET ${=NUMERIC:+-n $NUMERIC} "$@") +# zle .accept-line +# return 0 +# } -- cgit 1.4.1