zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: "Raymond W. Ko" <raymond.w.ko@gmail.com>, zsh-users@zsh.org
Subject: Re: Possible bug with bindkey and Unicode characters in 5.2?
Date: Tue, 08 Dec 2015 10:38:39 +0000	[thread overview]
Message-ID: <20151208103839.38196abc@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <5665F054.9070705@gmail.com>

On Mon, 07 Dec 2015 15:47:16 -0500
"Raymond W. Ko" <raymond.w.ko@gmail.com> wrote:
> bindkey -s θ '"\C-b"'
> bindkey -s ω "'\C-b'"
> bindkey -s υ ">\C-b<"
> bindkey -s σ "}\C-b{"
> bindkey -s φ ")\C-b("
> bindkey -s φ "asdf"
> bindkey -s ρ "]\C-b["
> 
> On zsh 5.1 and 5.0.1, this works as expected. However, in 5.2 there 
> seems to be a pause for half a second before a question mark appears.

Yes, this is a general problem.  This fix should be good enough.

I think there will be slight hiccups when there are a mixture of key
bindings for multibyte sequences and self-insert characters beginning
with the same bytes, but that's inevitable to some extent --- this should
certainly be no worse than before.  Bart ensured that even if we do
eventually need a self-insert it will work the way it always did, which
was fine in most cases, just a bit icky if you really needed the full
character to be inserted in good time.

(A volunteer to pick up ZLE testing would be useful.  Felix did quite a
lot of work on this some time ago which no one ever had the time to
merge.)

pws

diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 069580f..d6d116b 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -1503,7 +1503,7 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp)
 		    f->widget->flags & ZLE_VIOPER);
 #ifdef MULTIBYTE_SUPPORT
 	    if ((f == Th(z_selfinsert) || f == Th(z_selfinsertunmeta)) &&
-		!lastchar_wide_valid) {
+		!lastchar_wide_valid && !ispfx) {
 		int len;
 		VARARR(char, mbc, MB_CUR_MAX);
 		ZLE_INT_T inchar = getrestchar(lastchar, mbc, &len);


      parent reply	other threads:[~2015-12-08 10:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 20:47 Raymond W. Ko
2015-12-07 22:29 ` Mikael Magnusson
2015-12-08  9:47   ` Peter Stephenson
2015-12-08 10:38 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151208103839.38196abc@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=raymond.w.ko@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).