From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,MALFORMED_FREEMAIL, RCVD_IN_DNSWL_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a9402fc7 for ; Sun, 13 Oct 2019 08:03:07 +0000 (UTC) Received: (qmail 28214 invoked by alias); 13 Oct 2019 08:02:57 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24347 Received: (qmail 29307 invoked by uid 1010); 13 Oct 2019 08:02:57 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25598. spamassassin: 3.4.2. Clear:RC:0(205.235.26.22):SA:0(-0.3/5.0):. Processed in 3.556133 secs); 13 Oct 2019 08:02:57 -0000 X-Envelope-From: SRS0=udwr=YG=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at bounces.park01.gkg.net designates 205.235.26.22 as permitted sender) X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1570953732; bh=2o83NJP9PRoOKRDWrLVhTsmnO5FRymgkJiv72tXGtRc=; h=From:References:To:Sub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oLhSXk5cA.0wd9dFIwpxxrcRNjunvrnV5q6mHigoJ F3CxcHKMlGRie_KaJNtla8XZ_H.G743XtEpVdoCpqDKhNPs9osHiS0QLSh7VZLGiL2u9m1uVHbDz 7oOcpflUaf9vdjLF4qSrg01upBpUwxEaPVF.IoLDOFFXtf8jKJGR.Qv9pBY1pITRgaO6ZSCzZYGc LEuo6rGa2n7hK7a21xnQrxUZuFbu9NQc5gRROQNTrCoxmqC0MVeFkEjaKs4jjJzwfBzgBVpbbw2Y 54RT8B7yhTRj1Iw.C4sToolj6MZIUpfB4IbI.knc_BMjCjLYYbu14a5nouKAHn.cLHF0Y82uh5WT 4HulbsSzypmbsFlm3c3ipkbKTxWbG4PXyQNP28ANuQ_qcCu1akFeWcbUj9iyfhE.8omip2Wmv4KX Ru6i66CS605qUPN9hU77fInV7MuHa3KUlC1FufR1kkucd.Y5B9sSOlZHi3z6f3HljMRUJizoqM05 MoXvlbxJvtLwOkiprh0PtHM6wWur42lKUyx9na6zVqNG2E2TmU7KPOW3FIc2iY1p6h0lufLlPZOQ 36Hgr8Iix7zvDOlufXTl.yf_1yBe6eLv04Zpq28wxJc1Ixw-- cc: zsh-users@zsh.org In-reply-to: <20191012150611.rwjwhbiqpvwla656@NUX> From: Oliver Kiddle References: <20191012150611.rwjwhbiqpvwla656@NUX> To: Doron Behar Subject: Re: ZLE Vi-mode: visual mode selection doesn't match the characters highlighted MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11564.1570953730.1@hydra> Date: Sun, 13 Oct 2019 10:02:11 +0200 Message-ID: <11565-1570953731.113937@7Hja.mAXg.cCYH> Doron Behar wrote: > I'm having a small inconvenience with the way characters are highlighted > in visual mode. > > Say my $BUFFER has the following text, current $KEYMAP is "vicmd", and > the cursor is located where ^ is: > ZSH is the best shell > ^ > ----- (selected characters) > The problem is, that only the 3 characters ("bes") are highlighted so > it's not clear what characters exactly are selected. I can't reproduce this. Could you perhaps try with your setup/plugins disabled by starting from `zsh -df'. It may also be worth trying a different terminal emulator. If you use a vi command such as x or c, is the full region affected? If the position of the actual cursor is not highlighted, I would suspect that your terminal emulator uses standout (reverse video) for the cursor which combined with the default zsh use of standout for the region reverses it back to the original state. What do you have in the zle_highlight array? Try configuring the region, i.e. region:bg= It might also be worth configuring how your terminal emulator displays the cursor. The last character not being highlighted (the `t' of best) is curious. This seems to perhaps reflect the emacs mode style where you wouldn't expect `t' to be included in the selection because the original cursor can logically be viewed as being situated between the `s' and the `t'. This would imply a problem with the two lines in zle_refresh.c that read: } else if (invicmdmode()) INCPOS(region_highlights[0].end); invicmdmode() merely checks !strcmp(curkeymapname, "vicmd") If you're able to check curkeymapname at this point in a debugger, that might help. Note that it should be `vicmd' and not `visual' because `visual' is only used as a local keymap. If you've got some plugin that has replaced 'vicmd' then I'd expect that to have broken a whole lot more of vi mode. Oliver