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

Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected



On Sun, 9 Dec 2018 at 19:49, Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
>
> > Could the problem be fixed, .. ASAP?
>
> I won't be working on this, but I can give some poiners.
>
> You'll need to look in Src/Zle/zle_refresh.c.  You'll see the
> region_highlights variable that contains the information.  There are 4
> special regions at the start --- see definition of
> N_SPECIAL_HIGHLIGHTS.
>
> There are two key points in turning this information into the output.
> One is following the comment "Calculate attribute based on region".
> That's where the information gets encoded into the array of characters
> to output, which remembers the attributes associated with the character
> based on the last thing to change.
>
> The other is inside settextattributes(), where the appropriate sequences
> are output.  That's called at various points during the output, but only
> if we detect something has changed in them: zwcputc() is the key
> location, but you'll see there are others.

I think I've already resolved this in the patch in email "[PATCH] Make
256 color codes be based on zle_highlight array, not on termcap". The
function settextattributes() uses function from prompt.c:
set_colour_attribute(zattr atr, int fg_bg, int flags). It is there
where fg_start_code, etc. are read and set. Also, I think thath
zle_refresh.c code probably falls through to prompt.c –
output_colour(int colour, int fg_bg, int use_tc, int truecol, char
*buf), as I've had to change a condition there to not use termcap for
the 248 colors, but zle_highlight instead.

>
> > Could the problem be fixed, .. ASAP?
>

I was so pressured at this that I've done it myself :) it's in the
"[PATCH] Make 256 ..." email that contains the proposed patch.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



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