Loading ...
Sorry, an error occurred while loading the content.
 

Re: How to solve Bidi support in Vim/GVim

Expand Messages
  • Dotan Cohen
    On Tue, Nov 13, 2012 at 3:29 AM, Tony Mechelynck ... Though I cannot code it, I would be very happy to help with the implementation details. To be honest,
    Message 1 of 15 , Nov 13, 2012
      On Tue, Nov 13, 2012 at 3:29 AM, Tony Mechelynck
      <antoine.mechelynck@...> 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
    • Mohammad Heydari
      ... Tony, Is it possible to integrate a well implemented bidi library like fribidi? -- -- You received this message from the vim_use maillist. Do not
      Message 2 of 15 , Mar 23, 2015
        On Tuesday, 13 November 2012 05:00:42 UTC+3:30, Tony Mechelynck wrote:
        > If you think you know:
        > - the C language
        > - the Vim codebase
        > - the full-bidi conventions
        > - how they apply differently in different 'fileencoding's
        > all of that well enough to implement it, I suppose you can try writing
        > (at first) an unofficial patch (by "a patch" I mean "a set of changes,
        > possibly in several files, and possibly including the creation of new
        > source files"). If it works, then maybe Bram will decide to incorporate
        > it into Vim 8 or Vim 9. I have some textfiles with bidi text, but no
        > doubt you will be able to devise your own.

        Tony, Is it possible to integrate a well implemented bidi library like fribidi?

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Yuri Chernyavsky
        ... I see that vim touch open source app on android does bidi -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply
        Message 3 of 15 , Apr 29 8:59 AM
          On Tuesday, March 24, 2015 at 8:02:10 AM UTC+2, Mohammad Heydari wrote:
          > On Tuesday, 13 November 2012 05:00:42 UTC+3:30, Tony Mechelynck wrote:
          > > If you think you know:
          > > - the C language
          > > - the Vim codebase
          > > - the full-bidi conventions
          > > - how they apply differently in different 'fileencoding's
          > > all of that well enough to implement it, I suppose you can try writing
          > > (at first) an unofficial patch (by "a patch" I mean "a set of changes,
          > > possibly in several files, and possibly including the creation of new
          > > source files"). If it works, then maybe Bram will decide to incorporate
          > > it into Vim 8 or Vim 9. I have some textfiles with bidi text, but no
          > > doubt you will be able to devise your own.
          >
          > Tony, Is it possible to integrate a well implemented bidi library like fribidi?

          I see that vim touch open source app on android does bidi

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        Your message has been successfully submitted and would be delivered to recipients shortly.