Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected
- X-seq: zsh-workers 43876
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected
- Date: Sun, 09 Dec 2018 18:49:03 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1544381345; bh=ELvILWKAH27hJ7I8KG0c+kLuAUl//7oDd6EgzlkwJlc=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=mpbmn3SA+GD1/f37ncb+dyVQRvVQYPC+2oZIKOHS2G1sfJzEI9pPtEYAu4vvJGXU9 E3A3h4d52AT8RcyTx10HRfsre19RXZHTh2TeHEPrmd1l6vcDCou8iOsL5r964QOX/6 nZHNdIsPJaSXCeLvyYIYjNBDqHRpJd8yCANMv70mKcfWGk7zfxPH1HTAL6qjrsEZXE lG/f2GrpBv7E0t5RkfayaM2NQFGv+7PJrd07k5f9wjkwkTXLtJjrNcxw+MrWvshhX4 +2ysZBscGH2wZrVMJnSjujfpcXhv7OSzvQ5L2p2dZkDth0xtbX5YJPAHXnZ2U8KmEe nTGA9wvQNe1nA==
- In-reply-to: <CAKc7PVChj1t0sP1TesDPzuMo_hUR2e_nwWugXVoxb1S=dYROhw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBiJGhEqVjJc-17g0aBhiKdomiSWOXyuv3JyRS1x0Bbyw@mail.gmail.com> <CAKc7PVCgYRfw-oeASnACu5uvo598+=6JLj21LY2a3+RG6BE_Mg@mail.gmail.com> <1544168721.2479259.1601798392.35689542@webmail.messagingengine.com> <CAKc7PVChj1t0sP1TesDPzuMo_hUR2e_nwWugXVoxb1S=dYROhw@mail.gmail.com>
> 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.
The big issue here is that the shell is turning structured information
into a sequence to output --- it's not outputing a character with
particular attributes at a particular location, it's outputing a stream
consisting of a mix of characters and instructions to change
attributes. So, for example, if two changes logically occur at the some
point which one actually happens is, while supposedly well-defined
(can't remember the rules but I think they're documented, not
necessarily in full detail), is bug-prone.
If you're problem has got to do with line wrap, that's even worse ---
as widely noted in earlier threads, you're then fighting various
terminals and their definitions, too.
Good luck.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author