* Bram Moolenaar <[email protected]> [20/02/11 09:24]: > > Moshe Kamensky wrote: > > > I am interested in writing bidirectional text in Vim. I realise, from > > previous discussions on the list, the it would be difficult to support > > the bidi standard in Vim. However, I was wondering if a more manual > > approach would be easier to implement. What I had in mind was to extend > > the syntax highlighting system, to allow specifying the direction of a > > syntax region. This would mean that the direction of a character is > > determined by its syntax group, so no implementation of the bidi > > algorithm is necessary. Of course, displaying a string in the correct > > direction is more complicated than highlighting with a given colour, but > > perhaps it is easy enough (I'm not familiar with the code). > > > > If this can be done, I think it will solve most practical problems, > > since when editing latex, for example, text in different direction will > > appear in particular commands or environments. > > This might work for displaying the text, but how about moving the cursor > through it? And how would commands like "c2w" work when they cross the > bidi boundary?
I would say that commands that refer to logical parts of a text, like c2w, should ignore the display direction, and just work on the text. With cursor movements such as h and l, which (for me, at least) are "visual", I would prefer them to stay absolute (i.e., h is always move left). But I think either option is reasonable, and should be easy to get used to. In cases I have in mind, the embedded bidi segments would be rather complete logical units (e.g., an English phrase or a math formulas within a Hebrew sentence), so I would rarely want change two words across bidi boundaries. Thanks, Moshe -- 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
