about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2006-10-16 01:08:15 +0000
committerBart Schaefer <barts@users.sourceforge.net>2006-10-16 01:08:15 +0000
commit004d0886f1024be64b15fe05c503ee1171fccb4d (patch)
treed1204d6b1393514bf890e876dead9f1dbc1fa6d7 /Functions
parent38f01e72ea45e0e415d3aed74237b35ebad5dd29 (diff)
downloadzsh-004d0886f1024be64b15fe05c503ee1171fccb4d.tar.gz
zsh-004d0886f1024be64b15fe05c503ee1171fccb4d.tar.xz
zsh-004d0886f1024be64b15fe05c503ee1171fccb4d.zip
Add an example, as a comment.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Zle/keymap+widget19
1 files changed, 19 insertions, 0 deletions
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
+#  }