Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: region_highlight converts `fg=default` to `none`, which is not the same



On Thu, Oct 15, 2020 at 6:58 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
>
>
> > On 15. Oct 2020, at 10.37, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> > Going forward, we can extend the spec syntax to give users more
> > flexibility. I can see two extensions.
> >
> > 1. In addition to "underline", one can use "underline=on" and "underline=off".
> > 2. If the first character of the spec is "+", it's merged with the
> > current spec for the region; if the character is "=", it overrides;
> > otherwise the current behavior is preserved (specs with fg and bg
> > override, other specs merge).
> >
> > Thoughts?
>
> If you’re going to extend the spec syntax, could you consider adding more ANSI attributes, such as `faint` and `conceal`?

It's premature to say I'm going to extend the spec syntax. Just
thinking out loud, looking for feedback.

That said, extra ANSI attributes would be useful. My first choice
would be italic. The biggest problem with adding it is that zattr
doesn't have free bits left, so adding just one extra one/off
attribute would require changing the type of zattr from uint64_t to
some kind of struct, which would in turn require sweeping code changed
because zattr is used in so many places as an argument to bitwise
operators. I've spent a full day on this a few months back and
eventually stashed the change.

Another obstacle to supporting more ANSI attributes is the shortage of
upper- and lowercase letters that can be used in prompt expansions
(similar to %B/%b and %U/%u for bold and underlined). It would be a
shame if it was possible to use italic/faint/conceal in
region_highlight but not in prompt.

Note that the spec extension I proposed (or rather mused about) above
isn't affected by these challenges.

Roman.




Messages sorted by: Reverse Date, Date, Thread, Author