zsh-workers
 help / color / mirror / code / Atom feed
* region_highlight converts `fg=default` to `none`, which is not the same
@ 2020-10-12  9:22 Marlon Richert
  2020-10-13 11:05 ` Roman Perepelitsa
  0 siblings, 1 reply; 33+ messages in thread
From: Marlon Richert @ 2020-10-12  9:22 UTC (permalink / raw)
  To: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

Hi there, devs!

I am using `zsh-syntax-highlighting` and I want my paths to be blue, but
the slashes in there to be my terminal's default text color. I've tested it
and `zsh-syntax-highlighting` correctly puts, for example,

```
region_highlight=( '0 2 fg=10' '3 16 fg=4' '3 4 fg=default' '9 10
fg=default' )
```

where `3 16` is the path I'm trying to `cd` to and  `3 4` plus `9 10` are
the positions of slashes in the path.

However, after this assignment occurs, when I `print -r
"${(q+)region_highlight[@]}"`, I get as output

```
'0 2 fg=10' '3 16 fg=4' '3 4 none' '9 10 none'
```

and when the ZLE highlights the line, the slashes are rendered in the same
blue color as the rest of the path. If I use any other `fg` value than `
default`, then the slashes are colored correctly.

This seems like incorrect behavior to me, on two accounts:

 1. It seems incorrect to convert `fg=default` to `none`. From reading the
[documentation](
http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting),
`none` is not supposed to be the same as `fg=default`.

 2. It also seems incorrect to me that `none` effectively does nothing at
all. According to the documentation, `none` should mean that

    > No highlighting is applied to the given context.

    Instead, `none` just appears to do nothing at all, which seems useless
to me; if I don't want to change the highlighting of that part of the line,
then I can just not add a spec for it.

Do you agree and could someone be so kind as to fix this? :)

Cheers,

Marlon

[-- Attachment #2: Type: text/html, Size: 2698 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2021-05-31  1:17 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12  9:22 region_highlight converts `fg=default` to `none`, which is not the same Marlon Richert
2020-10-13 11:05 ` Roman Perepelitsa
2020-10-14  5:12   ` Marlon Richert
2020-10-14 20:46   ` Daniel Shahaf
2020-10-15  7:37     ` Roman Perepelitsa
2020-10-15 16:58       ` Marlon Richert
2020-10-15 17:09         ` Roman Perepelitsa
2020-10-16 13:36           ` Daniel Shahaf
2020-10-24  1:34           ` Oliver Kiddle
2020-10-24  6:42             ` Roman Perepelitsa
2020-10-16 13:28       ` Daniel Shahaf
2020-10-16 15:50         ` Bart Schaefer
2020-10-22 19:58           ` Marlon Richert
2020-10-22 23:28             ` Daniel Shahaf
2020-10-23  8:08             ` Roman Perepelitsa
2020-10-23  9:24               ` Marlon Richert
2020-10-23  9:35                 ` Roman Perepelitsa
2020-10-23 10:40                   ` Marlon Richert
2020-10-23 11:38                     ` Roman Perepelitsa
2020-10-24  0:50                       ` Functions/Misc/colors vs. region_highlight Bart Schaefer
2020-11-03 18:54                         ` Marlon Richert
2020-11-03 23:45                           ` Bart Schaefer
2020-11-04 15:47                             ` Marlon Richert
2021-04-18 21:40                         ` Bart Schaefer
2020-10-23 23:57                   ` Threading across year boundaries (was: Re: region_highlight converts `fg=default` to `none`, which is not the same) Daniel Shahaf
2021-03-31  8:26       ` region_highlight converts `fg=default` to `none`, which is not the same Marlon Richert
2021-04-10 20:33         ` Lawrence Velázquez
2021-04-13 15:20           ` Daniel Shahaf
2021-04-13 20:33             ` Roman Perepelitsa
2021-04-14 11:04               ` Daniel Shahaf
2021-05-09 20:49                 ` Lawrence Velázquez
2021-05-31  1:16                   ` Lawrence Velázquez
2021-03-31  8:24   ` Marlon Richert

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).