zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG?] If true-color is used, overlapping colors do not work
Date: Wed, 7 Nov 2018 15:40:17 +0100	[thread overview]
Message-ID: <CAKc7PVCp+zsjDwNnvk6XwdMz8XSgA66pmX5mZrYt+c9sZxy3TQ@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVDgEtfLAibbxRr36=UgPoPk8grvsH5G2+AOipr_vmt-cQ@mail.gmail.com>

A simpler way to observe this:

% zsh -fi
% rh_widget() { BUFFER="true"; region_highlight+=( "0 4 fg=#00cc00" ); rh2; };
rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
zle -N rh_widget
bindkey "\C-a" rh_widget
% <press ctrl-a>
On Wed, 7 Nov 2018 at 14:19, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> Hello
> The last test from the attached ztst reveals this. Before-last test overlapping colors with standard fg=green/fg=red symbols. Result is a word "true" with "r" in red the rest in green. You can see the colors by doing cat /tmp/output.
>
> With true color, I get:
> --- /tmp/zsh.ztst.77121/ztst.out    2018-11-07 14:11:51.000000000 +0100
> +++ /tmp/zsh.ztst.77121/ztst.tout    2018-11-07 14:11:51.000000000 +0100
> @@ -2,5 +2,5 @@
>  rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
>  zle -N rh_widget
>  bindkey "\C-a" rh_widget
> -0m32mt31mr39m32mue39m
> +0mt38;2;204;0;0mr39mue
>
> The minus-line is not yet updated, inherited from basic 8-colors case (which is working and overlapped colors can be observed in the minus-line). But look at the plus-line. It doesn't emit any color for "t", only true-color red for "r", and then nothing for "ue".
>
> With zsh/nearcolor loaded (test code pasted at the end of this email), colors are correctly overlapped:
>
> --- /tmp/zsh.ztst.76836/ztst.out    2018-11-07 14:09:32.000000000 +0100
> +++ /tmp/zsh.ztst.76836/ztst.tout    2018-11-07 14:09:32.000000000 +0100
> @@ -3,5 +3,5 @@
>  rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
>  zle -N rh_widget
>  bindkey "\C-a" rh_widget
> -0m32mt31mr39m32mue39m
> +0m38;5;40mt38;5;160mr39m38;5;40mue39m
>
> cat /tmp/output confirms this.
>
> zsh/nearcolor test case:
>
>   zpty_start
>   zpty_input 'zmodload zsh/nearcolor'
>   zpty_input 'rh_widget() { BUFFER="true"; region_highlight+=( "0 4 fg=#00cc00" ); rh2; }'
>   zpty_input 'rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }' # `r' in red; the above line would be too long
>   zpty_input 'zle -N rh_widget'
>   zpty_input 'bindkey "\C-a" rh_widget'
>   zpty_input $'\C-a'
>   zpty_line 5   # 3 lines echoed back + 3 empty lines (zpty bug)
>   zpty_line 1 p
>   zpty_stop
> 0:overlapping region_highlight with true-color
> >zmodload zsh/nearcolor
> >rh_widget() { BUFFER="true"; region_highlight+=( "0 4 fg=#00cc00" ); rh2; }
> >rh2() { region_highlight+=( "1 2 fg=#cc0000" ); }
> >zle -N rh_widget
> >bindkey "\C-a" rh_widget
> >0m32mt31mr39m32mue39m
> >exit
>
> --
> 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

  reply	other threads:[~2018-11-07 14:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 13:19 Sebastian Gniazdowski
2018-11-07 14:40 ` Sebastian Gniazdowski [this message]
2018-11-07 19:19   ` Sebastian Gniazdowski
2018-11-08  3:48     ` Oliver Kiddle
2018-11-08  9:25       ` Sebastian Gniazdowski
2018-11-08  3:03 ` Oliver Kiddle
2018-11-08  9:19   ` Sebastian Gniazdowski
2018-11-09  1:28     ` Oliver Kiddle
2018-11-09 15:39       ` Sebastian Gniazdowski
2018-11-11  0:43       ` Sebastian Gniazdowski
2018-11-11  5:11         ` Sebastian Gniazdowski
2018-11-24 17:32         ` highlight test cases (was Re: [BUG?] If true-color is used, overlapping colors do not work) Oliver Kiddle
2018-11-30  0:34           ` Sebastian Gniazdowski
2018-12-07  1:55             ` [BUG] General 256 colors bug – zle_highlight / fg_start_code, etc. is not respected (was: highlight test cases) Sebastian Gniazdowski
2018-12-07 20:26               ` Sebastian Gniazdowski
2018-12-09 19:13                 ` Daniel Shahaf
2018-12-11  8:06                   ` Sebastian Gniazdowski
2018-12-10  2:54             ` highlight test cases (was Re: [BUG?] If true-color is used, overlapping colors do not work) Oliver Kiddle
2018-12-10 23:51               ` Sebastian Gniazdowski
2018-12-10 23:54                 ` Sebastian Gniazdowski
2018-11-11  5:38       ` X04 zle highlight tests, near-color bug Sebastian Gniazdowski
2018-11-18 15:34         ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKc7PVCp+zsjDwNnvk6XwdMz8XSgA66pmX5mZrYt+c9sZxy3TQ@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).