Stefan Schimanski wrote:
Continuing the discussion about the space issue here.

I have implemented Georg's idea/hint to allow spaces on both sides of the RTL/LTR boundary, but let the empty-paragraph-mechanism (EPM, the algorithm which among other things kills double spaces) take care of double spaces around boundaries. Of course this needs the vis2log/log2vis functions from the bidi object to get the logical position of the character visually next to a space. I tried to make the usage as safe as possible, i.e. ask for the range of the bidi cache and so on. You will find the patches attached, to be applied in this order:

no_bidi_isboundary.patch
no_bidi_setcurrentfont.patch
cursor_get_font.patch
rtl_spaces.patch

@Dov: quilt is nice, thanks again for the hint

Yeah, isn't it? :)


The patch of interest here is the last one, inlined below.

The basic idea is that the EPM considers the spaces in "abc [ WERBEH]ghi" to be next to each other. So starting with abc[ WERBEH]ghi" you can enter space behind the abc and continue writing, or change your mind after the space and the EPM takes away the new space:

  "abc|[ WERBEH]ghi" => "abc |[ WERBEH]ghi" => "abc|[ WERBEH]ghi"

Similary for "abc [|WERBEH]ghi".

Opinions?

Stefan


Stefan, I like it!

I haven't gone over the code at all yet, I hope to be able to do that over the weekend, maybe. But in terms of the behavior --- I like it a lot. And it solves all of the related crashes that I know of. And I think that it's the right approach in terms of not using any magic (except while typing in, if you can all the EPM magic...).

I didn't think I would like the EPM business, but now that I see what you mean, I think it's a good idea! There are still some minor issues to work out, though:

1) type 'abc' F12 <space> 'def' F12 <space> 'ghi'

You get this (visually):

abc[FED ] ghi

Shouldn't the EPM have gotten rid of one of the spaces between 'D' and 'g'?

2) This one I'm not able to reproduce reliably: sometimes I'm losing a space which should *not* be lost: after playing around on a boundary, trying to insert spaces and watching them magically disappear, I sometimes lose also the last space that was there. Again, I don't have a recipe for reproducing this yet, so I may be wrong, but I suggest trying to play around there. Or maybe a solution to the above issue will solve this, too.

I'll try to go over the code in the next few days, and it would be great if other bidi users could test this and see what they have to say about it. But as far as I'm concerned, this is OK to go in (preferably with a fix for the above issues; but even without them, I think it's better than the current situation), so that we can get as much testing as possible before the final release.

Thanks again, Stefan!

Reply via email to