* Tony Mechelynck <[email protected]> [13/11/12 03:30]: > On 12/11/12 07:37, Mostafa Shahverdy wrote: > >Ben: I want to write some web pages with PHP, in Persian. > > > >Tony: How is it so that there can not be any kind of extension to handle > >BiDi algorithms in Vim itself(and not terminal)? > > 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. >
I once tried it, and it does not seems very easy. But I think there is an alternative approach. The way I edit bidi text is the following: I use rxvt-unicode, which has perl plugins. In particular, it allows callbacks before (and after) displaying the text, and the plugin may modify the displayed text. I use it together with a perl interface to the Fribidi library to display the text correctly. This results in something similar to the mlterm solution, but with urxvt, which I prefer. My point, though, is that if vim allows similar callbacks, i.e., the possibility to call a vim script before and after the visual text is displayed, then it will be possible to apply the bidi algorithm on the level of a vim script, rather than on the level of the code itself. Of course, it will be much slower, but in my experience with urxvt, it is a price I am willing to pay for the possibility to edit mixed text properly. And I imagine it would be useful for other purposes as well. 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
