Ali Gholami Rudi wrote:
> Bram Moolenaar <[email protected]> wrote: > > Ali Gholami Rudi wrote: > > > This patch replaces switch statements in arabic.c with a static array of > > > struct achars. This makes adding new letters a lot easier and that > > > usually involves only adding an entry to this array (I've already added > > > Farsi letters). > > > > > > This is also a clean up patch and reduces more than 1k lines. After > > > applying this patch arabic.h holds only a macro definition. So it is > > > probably a good idea to remove arabic.h completely and move the trivial > > > ARABIC_CHAR macro to another header. > > > > It's good to see some cleanup work in this area. > > > > I wonder how we check for any mistakes. Very few people use this code, > > thus a mistake may go unnoticed for a long time. > > > > Perhaps you can write a test that passes before this change and also > > after this change? The test could use some kind of table, so that we > > can see all the combinations are used. > > It is probably possible to access the characters Vim prints on the > screen; I mean just after shaping (I have to look it up but of course > you know better). If so, it might be a good idea to use a sample > Arabic/Farsi text file. The output after shaping the letters can be > written to another file (as expected this file will contain Unicode > presentation forms of letters among other chars). It can be kept as > a reference to indicate the change in behaviour after changing > arabic.c. Does that look sane? Have a look at the files src/testdir/*.in. These are "what you type" scripts and the verified output can be the text after shaping. The trick will be to make some kind of table to avoid having to use all kinds of special characters that make the script unreadable (there are plenty of bad examples :-). Perhaps feedkeys() can be used. > By the way, I'm very doubtful if anyone is using farsi.[hc] nowadays. > After this change Vim will fully support Farsi using utf-8, so you might > decide to remove it, too. Let's do that after we know it works to type Farsi the new way. So long as there are no build problems we might keep it. -- Engineers are widely recognized as superior marriage material: intelligent, dependable, employed, honest, and handy around the house. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
