On Thu, 02 Jul 2009 20:03:02 +0200, Bram Moolenaar wrote:

> Adriaan Pater wrote:
> 
>> When I open a UTF-text file with right-to-left-text (hebrew in this
>> case) and left-to-right-text (english in this case) in gedit it is
>> rendered OK (rtl is displayed as rtl, ltr is displayed as ltr).
>> 
>> But when I open the same file in gvim the right-to-left text (hebrew)
>> is showed as left-to-right text (just as the rest of the file, cq.
>> english).
>> 
>> Is there a way to get the same behaviour as in gedit?
>> 
>> I searched for :help already and found things like mlterm, termbidi,
>> set bomb etc. but I just can't gvim to show the text like gedit.
> 
> No, the whole text is either LTR or RTL.
> 
> I have never understood why people put the text in the wrong order in
> the file and then change the order when displaying it.  The characters
> should be in the file in the order they are displayed.
> 
> Perhaps there is a filter that change the order for this kind of file.

They're stored in the file in "logical order", which is the order that 
the reader processes them when reading. That means, if he has an English 
document with some embedded Hebrew, then when he encounters the first 
Hebrew letter, his eyes will skip to the end of the Hebrew phrase (or the 
end of the same line if it's a multi-line hebrew phrase), and start 
working backwords until he hits the English, at which point his eyes will 
skip again across the Hebrew to the English text that follows the Hebrew. 
This is "logical order", and it's the order he reads in.

It's also the order that a computer would use if it were:
* lexicographically comparing mixed-language strings
* performing text-to-speech conversion
* rewrapping paragraphs
* it is the order in which text is typed at the keyboard.

See pages 19-20 of the Unicode Standard 5.0 (available online at http://
unicode.org/versions/Unicode5.0.0/ch02.pdf)

Since display is the only part of the system that doesn't operate in 
logical order, it's logical to put the conversion into the display 
routines, rather than putting it into the file itself where it screws up 
every other operation the computer has to perform on it.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to