Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected
- X-seq: zsh-workers 43866
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected
- Date: Fri, 7 Dec 2018 02:42:01 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=hOHpEareeJSKIU94/rCbBwRQq/VycGSYNl+eedgY844=; b=ji5ugXrW7roUr0eWxCAFanhahv38XUwHoQUUQLFOwf9qW+kBq1DsVHJjTTZx5972yU NldXn5W1eF8/lbJLYB4CGpVahg9nmFIITxq9ZHuAKmUvs1/79GFfA157tsHoDkAJ5pn2 a6ZheFk8X596ZKZTHq9g8QqLU0z8Ow3QipbUKsnx7KNyzYfzCau1Ke/4UGoGnFZ+BRb+ CYA7uAVN0SturJd+4vyTBcY0BusX6du1WNcRj0k2uCNApYNWnMITyIPaZKM4w6PLqQvO X6yxu2Vi5UgKNkboi8Kcpcee4R330GUz6kJyeDz+rqQogp85ER4MFeigQFBtYjsf9yWA +HyQ==
- In-reply-to: <CAKc7PVBiJGhEqVjJc-17g0aBhiKdomiSWOXyuv3JyRS1x0Bbyw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBiJGhEqVjJc-17g0aBhiKdomiSWOXyuv3JyRS1x0Bbyw@mail.gmail.com>
I've tested this further. Turns out that when there is no previous
style applied, a magical from-nowhere inverse mode (i.e. standout)
appears on first selected character:
https://asciinema.org/a/KcB0iZNSx4QsYvHFWCT7kFsV2
The point is: I've changed "standout" to "fg=green", and did = not +=
on region higlight (to cancel any highlighting) – I never did any
"standout"/inverse mode, so from where it comes?
That said, in X04 tests this works (more on the tests in separate
thread) – only 'u' is highlighted with standout. So I wonder what can
lay (an option?) behind in-realword additional-inverse and
in-syntetic-test correct no-additional-inverse. Expecially because
this test also is free from additional-inverse:
widget() { BUFFER="true word2 word3"; region_highlight+=( "0 5 fg=196"
); widgb; }; widgb() { region_highlight=( "2 3 standout" ); };
zle -N widget
bindkey '^T' widget
On Thu, 6 Dec 2018 at 08:03, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello,
> if the first character at which "$start $end standout" should be
> applied, i.e. $start character, is already highlighted, the style
> standout will not be applied to it:
>
> http://psprint.blinkenshell.org/standout-wrong-1.gif
>
> Confirmation: If I manually force F-Sy-H code to clear previous
> region_highlight content's before appliying "$start $end standout" to
> region_highlight, then everything works – i.e. also $start character
> is highlighted:
>
> http://psprint.blinkenshell.org/standout-ok-2.gif
>
> So basically the problem is: no standout-highlighting of $start
> character if region_highlight has already an entry covering the $start
> character.
>
> I.e. region_highlight+=( "$start $end standout" ) will not work for
> $start character.
>
> A more permanent link for the gifs:
>
> https://github.com/zdharma/fast-syntax-highlighting/issues/92#issuecomment-444768370
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author