about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-11-24 14:51:34 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-11-24 14:51:34 +0000
commitfa503c84d3e796372d45c058dd65c90720e074ae (patch)
treedd8871a219a6b899b59f04f389b90668eec1dacc /Functions
parent5dfd592bf2ffe9336d4ba7e827f50e275c96ee37 (diff)
downloadzsh-fa503c84d3e796372d45c058dd65c90720e074ae.tar.gz
zsh-fa503c84d3e796372d45c058dd65c90720e074ae.tar.xz
zsh-fa503c84d3e796372d45c058dd65c90720e074ae.zip
22021: back-to-back Unicode insertions didn't work.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Zle/insert-unicode-char7
1 files changed, 6 insertions, 1 deletions
diff --git a/Functions/Zle/insert-unicode-char b/Functions/Zle/insert-unicode-char
index 0ffd29418..af9aad914 100644
--- a/Functions/Zle/insert-unicode-char
+++ b/Functions/Zle/insert-unicode-char
@@ -1,7 +1,10 @@
 # Make hex integers appear as 0x...
 setopt localoptions cbases
 
-if [[ $LASTWIDGET = insert-unicode-char ]]; then
+integer -g _insert_unicode_ready
+
+if [[ $LASTWIDGET = insert-unicode-char && $_insert_unicode_ready -eq 1 ]]
+then
   # Second call; we should have a usable prefix.
   # If we don't, give up.
   (( ${+NUMERIC} )) || return 1
@@ -9,9 +12,11 @@ if [[ $LASTWIDGET = insert-unicode-char ]]; then
   local -i 16 -Z 10 arg=$NUMERIC
   # ...and use print to turn this into a Unicode character.
   LBUFFER+="$(print -n "\U${arg##0x}")"
+  _insert_unicode_ready=0
 else
   # Set the base to 16...
   zle argument-base 16
   # ...wait for user to type hex keys then call this widget again.
   zle universal-argument
+  _insert_unicode_ready=1
 fi