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

Re: Feature request: italic style in region_highlight

On Thu, Jan 2, 2020 at 8:18 PM Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> That sounds useful, expecially italic.

Yesterday I started adding italic support throughout. Once it's there,
there would be no need for custom standout_on_code/standout_off_code
overrides. Plain "italic" style would surely be nicer.

> The lack of free bits in zattr (TXT macros) may be something of an
> impediment. It isn't really important to prompts but would matter for
> zle. There may be ways to recover bits, for example we have both
> TXTBOLDFACE and TXTNOBOLDFACE which allows the code to distinguish the
> actions but is redundant in terms of tracking attributes.

Yep, I've already discovered this. If this was C++, I would just make
zattr std::bitset<84> and be done with it. Once could wish. Instead,
I've made zattr a struct with 3 fields: attr for on/off attributes and
fg and bg for colors. Each of these 3 fields is 4 bytes (I could make
attr 2 bytes but it won't save anything due to alignment
requirements). I don't want to spent much of your time on this as it's
not close to being done. Will send a patch when I get through with it.

> %O/%o (for "oblique") would be available. I realise that an oblique font
> is not strictly the same as italic.

Perfect timing. I wanted to ask which alternative letter to use as %a
is taken by something (watch, perhaps?). %O/%o sounds good.

> I like the idea of %A{...} but would favour symbolic names over numbers

Another benefit of symbolic names is that zsh will know how to flip
the attribute on and off. And the UX complexity will stay pretty much
where it is now. %O and %o will work exactly like %U and %u and
similar sequences. Easy to understand. With %A{...} we would have to
explain how it interacts with the other sequences. E.g., does %u
cancel %A{4}?


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