From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28977 invoked by alias); 13 Sep 2015 03:42:56 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36525 Received: (qmail 7283 invoked from network); 13 Sep 2015 03:42:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:to:subject:mime-version :content-type; bh=+HYDQt9pZu9hsIt3RQrjNxHIt2oHb40p+fVp7tsErDA=; b=CeUsiZqkmgiwb4oZYtJK2oWDwOMAWWoigI5F6bQ3UpIgpn3lNXtXjc5UCwA/H9YQFm LadfDl4rOZvJSwoE1o6Q/0LnYeRrDD6SX2yEZMLZWOm5cxM8lvMFDW/SGaXD/Na/Whil ohqndsBTAR+aBRtgkJjABUfcG89TsxoYUOrk9yNo/Ys39mJeQ5LnBEu+GiZVvMSSJj5i N+D3DRtdvRJcecez6tiqSHmhNOVh1X4pRvBZHY6T0BpEGmJPkHdaDR8Apre/N/3S61a4 d1ywNDOZuF3cCsqFolQpLrgNSRn6oAycVBYRq+gcXHKKbh2ALdYPc1OX5lFhvBfEW+hg 6wlg== X-Gm-Message-State: ALoCoQnZnAusOwcdFBwJ4xFjyuRWF+jQ1qpiJRYvF0Z4heMFjbSzBxKul1DwAEdwTBG9lirZ8D6H X-Received: by 10.202.9.132 with SMTP id 126mr4953068oij.4.1442115770277; Sat, 12 Sep 2015 20:42:50 -0700 (PDT) From: Bart Schaefer Message-Id: <150912204247.ZM29168@torch.brasslantern.com> Date: Sat, 12 Sep 2015 20:42:47 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Multibyte read errors on self-insert MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Peter's patch in workers/36496 included this bit of selfinsert(): #ifdef MULTIBYTE_SUPPORT - if (!lastchar_wide_valid) - if (getrestchar(lastchar) == WEOF) - return 1; + DPUTS(!lastchar_wide_valid, "keybuf did not read full wide character"); #endif It's trivial to cause this warning to appear starting from zsh -f: torch% autoload zed torch% zed -f pickle pickle() { } Now move the cursor to the beginning of the line with the "}" and press TAB. In addition to the warning, a newline is inserted instead of a tab. 91: Src/Zle/zle_misc.c:118: keybuf did not read full wide character This is because selfinsert() was called from expandorcomplete(), so the special cases in getkeymapcmd() do not apply. There are a bunch of places where selfinsert() may be entered indirectly, so I think the easiest thing is to back out that hunk of the patch even though it is redundant in the pure self-insert widget case. diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index 297dc4c..0483f75 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);