Zsh Mailing List Archive
Messages sorted by:
Re: ZLE Vi-mode: visual mode selection doesn't match the characters highlighted
- X-seq: zsh-users 24347
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Doron Behar <doron.behar@xxxxxxxxx>
- Subject: Re: ZLE Vi-mode: visual mode selection doesn't match the characters highlighted
- Date: Sun, 13 Oct 2019 10:02:11 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1570953732; bh=2o83NJP9PRoOKRDWrLVhTsmnO5FRymgkJiv72tXGtRc=; h=From:References:To:Subject:Date:From:Subject; b=dCtHry5WdCJKS3h3UKs3vJrJFlu8ZUeFvh7hyo5OEHaihmN9fZ03grz+Vz06LCqE5ez3jJ93as55polbgFtrfzRe5+Idy41PxQ2Ac/Ou5ZjgfJ/yOu2dttqGdLjYKkY0vIu9iVRiHICOnwbTpZSUmxPlGltAYk3kwFAPxm7gANndpvUOWrvMzNwZCGTLARzYtCTNEIy+TTCVHxYlWkIhZCQkXVkXczKD/7YaIrtPiyAki4FHiAcHVOMypCQLQmrikkn140zXnZKTpThR3LU9A9kHtymH6ex8JCfkRRyXFyKnQ5wCyzZ4YkeyRFQxKAHJQGB4dYUK3LIBPmPjm8C19g==
- In-reply-to: <20191012150611.rwjwhbiqpvwla656@NUX>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- List-unsubscribe: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20191012150611.rwjwhbiqpvwla656@NUX>
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=<something> 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
} else if (invicmdmode())
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.
Messages sorted by: