On Tue, Nov 13, 2012 at 3:29 AM, Tony Mechelynck
<[email protected]> wrote:
> But I think doing it well would be a whole can of worms. I'm not sure it is
> possible to do it correctly in all cases, including those where part or all
> of the directionality is defined in a file external to the one being edited
> (e.g.in a style sheet for HTML or similar). It might require a complete
> overhaul of not only "ordinary" display but also syntax highlighting, since
> how to handle <span dir="rtl">…</span> in HTML might be better defined in an
> HTML syntax script than in the "core" display routines… Not to mention more
> complicated (recursive) embeddings such as
>
> <p dir="ltr">english1 <span dir="rtl">farsi2 <span dir="ltr">english3 <span
> dir="rtl">farsi4</span> english5</span> farsi6</span> english7</p>
>
> (I ought to have shown it with mixed Arabic and Latin script but I'm lazy)
> which will have to be displayed (if on a single screen line!) as
>
> english1 6israf english3 4israf english5 2israf english7
>
> (IYSWIM) because the underlying structure (English text quoting a Farsi
> phrase which itself quotes an English phrase which etc.) is
>
> <p> → → → → → → → → → → → → → → → → → → → → → → → → </p>
>          </span> ← ← ← ← ← ← ← ← ← ← ← ← <span>
>                 <span> → → → → →  </span>
>                          ←<span>
>
> Then if soft-wrapping (due to narrow window width and 'wrap' on) happens in
> the middle of the "farsi4" span, we get:
>
> [english1 english3 {raf 2israf
> 6israf 4is] english5 english7}
>
> where [ or ] is the start of the screen line and { or } its end. Not
> obvious, is it?
>

Though I cannot code it, I would be very happy to help with the
implementation details. To be honest, Mozilla applications have this
down pat, and that could be used as a reference for cursor behaviour.
In any case, see this page (disclaimer: my own website) explaining how
RTL and LTR spans work together:
http://dotancohen.com/howto/rtl_right_to_left.html

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to