about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-09-12 20:49:13 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-09-12 20:49:13 -0700
commit8a818381cfa843f6bdc25e3517500da31d63c282 (patch)
treed2628a05eb4e77072dc6801e9c8d008f0bd37afe
parent9cb8c3f4b5d9918028791d975cf3aa7d745b4b22 (diff)
downloadzsh-8a818381cfa843f6bdc25e3517500da31d63c282.tar.gz
zsh-8a818381cfa843f6bdc25e3517500da31d63c282.tar.xz
zsh-8a818381cfa843f6bdc25e3517500da31d63c282.zip
36525: revert only the selfinsert() bit of 36496
selfinsert() may be called with incomplete wide character processing from
places other than getkeymapcmd()
-rw-r--r--ChangeLog4
-rw-r--r--Src/Zle/zle_misc.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index db594cc5d..79fb2c779 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 
 2015-09-12  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 36525: Src/Zle/zle_misc.c: revert only the selfinsert() bit of
+	36496 because selfinsert() may be called with incomplete wide
+	character processing from places other than getkeymapcmd()
+
 	* unposted: Functions/Zle/bracketed-paste-magic: revert 36483 as
 	multibyte is now handled by "zle .read-command"; adapt to new
 	default behavior of zle_highlight for paste
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 297dc4ca8..0483f758d 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -115,7 +115,10 @@ selfinsert(UNUSED(char **args))
     ZLE_CHAR_T tmp;
 
 #ifdef MULTIBYTE_SUPPORT
-    DPUTS(!lastchar_wide_valid, "keybuf did not read full wide character");
+    /* may be redundant with getkeymapcmd(), but other widgets call here too */
+    if (!lastchar_wide_valid)
+	if (getrestchar(lastchar, NULL, NULL) == WEOF)
+	    return 1;
 #endif
     tmp = LASTFULLCHAR;
     doinsert(&tmp, 1);