[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Line wrap reconsidered

From: Yuan Fu
Subject: Re: Line wrap reconsidered
Date: Thu, 18 Jun 2020 17:46:53 -0400

Hi Eli,

Sorry for the delay.

> The iterator thinks the characters are displayed from left to right,
> so it does its calculations as usual.  The order reversal happens
> because each new glyph is prepended to the previous glyphs, not
> appended as in the LTR case (but the iterator doesn't know that).  So
> the white space you see at the left side is actually computed and
> added at the end, when all the other characters are already in the
> glyph row and their width is known.

After reading your reply I went back and scratched my head on why my code 
doesn’t work, because based on your information my code logic is correct. Turns 
out it’s merely because I didn’t handle enough cases for it->what (I only 
handled when it->what == IT_CHARACTER). I updated my code to handle other cases 
and it now works in bidi!

I have to do another change for kinsoku.el to work right in bidi. Kinsoku.el 
defined NOT_AT_BOL and NOT_AT_EOL categories. These categories are flipped in 
bidi paragraphs: what was EOL becomes BOL and vice versa. So I flipped them in 
my predicate function depending on it->bidi_p.

Now the word wrap and kinsoki works in both normal and bidi paragraph.

P.S., I think I fixed all the indentation with tabs.


Attachment: word-wrap.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]