From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14836 invoked by alias); 16 Sep 2016 23:36:51 -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: 39369 Received: (qmail 15203 invoked from network); 16 Sep 2016 23:36:51 -0000 X-Qmail-Scanner-Diagnostics: from nm36-vm3.bullet.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(212.82.97.135):SA:0(0.0/5.0):. Processed in 0.386065 secs); 16 Sep 2016 23:36:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.mail.yahoo.com designates 212.82.97.135 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1474068634; bh=J+C//gKiInx5+L9fYpnEG5SngMfs5cC+2uPALM1/3ns=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=Ozefcly+pqGy66O8ps2TMFQsN4FtYauQlr6TgHiXymZt4xI0ML2bKj5EmjyGwjGGy/GnOkXhfza3WNEiduIsmZ/xnT35SV6eXgVqQ9etWube3I1buPGbsso2uPBdui5TP8sWp6Ly+++uMtDeFfsmqDlGn/JRGNUCB3+6arEax47PQD6sk5syzgmBCSP8G/pHB8HX8sMRI7RxJwohrZy62Qz8IflJ+i0ruNuak0Kipxm5ShCc4DUX6Rr0p3BAQrrT732SQf1/+hZ+XB8WwaQaTTYUrI35Fa4EJrbmdDjL1C0AjigSn/LkMzNp+CX58eVl50OUiSQ0Y3s8ZCnLH5gkIg== X-Yahoo-Newman-Id: 264046.44461.bm@smtp133.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: rn2IWQAVM1nGfbkWEBhfUrEYKC12DzF7DW0DJq3Y70y8RT6 CGjrXxr_emgIp0a2ecfOmSRSR03a8wptgitB5F73cT0.Lie6po5KALNf563Z 0k7OB9lJjyjzWa4zbnQKjSO0.EdfWiN2SEYIFAbuY6HP3Io7wl1zf9JgRjAi NPWpZd3pucIxTMgd39YgqWfrtoUGGR.Wl.kId2i3GuCVSukifJbMgyZWCFWn 1_hqcEj8yUFManRnYFr.uFgS1VWGV8q1q3ghyPwDgH_l56SH6sYg0L9gGvrz 2_syzKzqHhAuDTFJZaK5t.Ce6EQHFlERw6b0Y1wW3wOAaTYsgw.lIGCxD6yd jmXzgzU.z4VI0y9.lq.lx2PecCoS89Z0zSYW.RtmUkJh825U0FzEJXAajpvD WTQg__aUqdbw8lfpbcOVT1euUc7rVYzlVN8rOcfgXxCQ5DX3.Pniq_lxuD1r gJvJTQ01OflJjhoefYa299PCF8L_712NpzaNhXLJ49AZgCyyGbmxTUSNFT7m oESABnb6CDTsadyj_MLoqvHrbOaqXaclEqx9Xk9Bjmq4- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <160916142248.ZM26196@torch.brasslantern.com> From: Oliver Kiddle References: <160916102137.ZM11290@torch.brasslantern.com> <76020.1474058827@hydra.kiddle.eu> <160916142248.ZM26196@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: Off-by-one with select-*-shell-word text object? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10733.1474068633.1@hydra.kiddle.eu> Date: Sat, 17 Sep 2016 01:30:33 +0200 Message-ID: <10734.1474068633@hydra.kiddle.eu> Bart wrote: > } Or a ZLE_ flag - actually two to cover > > I think one flag to force the equivalent of set_bindk = 1 would do? > (zle_main.c:1358) That seems like a nice simple solution. Especially if there aren't any that need set_bindk = 0 as you suggest below. > It also occurs to me to wonder whether set_bindk = 0 *ever* makes sense > for builtin widgets. Can somebody give me an example of a builtin that > would care about the widget name of its user-defined caller? I think it matters for the k2 == bindk test in getvirange(). That's the code that ensures that pressing the same key twice indicates that the vi command should operate on a line. Builtin widgets that call getvirange() all have the ZLE_VIOPER flag set so could be selected for on the basis of that. zlecallhook sets set_bindk. That doesn't seem entirely useful ($WIDGET is zle-keymap-select etc) but if it did the opposite, that could matter here because you'd get something like vi-cmd-mode instead of the calling widget. run-help, which-command and zap-to-char suffer from the same issue as the text object widgets: they use bindk to select their behaviour. So any thoughts on this solution? Oliver diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c index 9107154..345534e 100644 --- a/Src/Zle/zle_thingy.c +++ b/Src/Zle/zle_thingy.c @@ -756,7 +756,10 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) } t = rthingy(wname); - ret = execzlefunc(t, args, setbindk); + /* for internal widgets we don't want bindk set except for when getting + * a vi range to detect a repeated key */ + ret = execzlefunc(t, args, setbindk || + (t->widget && (t->widget->flags & (WIDGET_INT | ZLE_VIOPER)) == WIDGET_INT)); unrefthingy(t); if (saveflag) zmod = modsave;