From: Marlon Richert <marlon.richert@gmail.com>
To: zsh-users@zsh.org
Subject: Bug report: region_highlight converts `fg=default` to `none`, which is not the same
Date: Tue, 13 Oct 2020 13:42:25 +0300 [thread overview]
Message-ID: <CAHLkEDsSF=4eiVirJzYiBwT4LaR9_LHk6eW=EgUcWtSZOr_F2A@mail.gmail.com> (raw)
In-Reply-To: <CAHLkEDv9ch+nhtpYF3So+029J6GMv5iU-8=RzHRHLa7OYzc3kg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]
Hi there, Zsh devs!
I am using Zsh 5.8 with `zsh-syntax-highlighting`. I want my paths to be
blue, but I want the slashes in each path to be my terminal's default text
color. I've configured `zsh-syntax-highlighting` to do so and it 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: 2807 bytes --]
next parent reply other threads:[~2020-10-13 10:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHLkEDv9ch+nhtpYF3So+029J6GMv5iU-8=RzHRHLa7OYzc3kg@mail.gmail.com>
2020-10-13 10:42 ` Marlon Richert [this message]
2020-10-14 20:46 ` Daniel Shahaf
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='CAHLkEDsSF=4eiVirJzYiBwT4LaR9_LHk6eW=EgUcWtSZOr_F2A@mail.gmail.com' \
--to=marlon.richert@gmail.com \
--cc=zsh-users@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).