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

Re: [PATCH] make adding new letters to arabic.c easier

Expand Messages
  • Bram Moolenaar
    ... 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
    Message 1 of 46 , Jun 1, 2009
      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.

      --
      The budget process was invented by an alien race of sadistic beings who
      resemble large cats.
      (Scott Adams - The Dilbert principle)

      /// Bram Moolenaar -- Bram@... -- 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
      -~----------~----~----~----~------~----~------~--~---
    • Ameretat Reith
      On Wed, 08 Oct 2014 08:11:34 +0330 ... For ZWNJ, I did a tiny modification telling `arabic_shape` in one of it s invocations, to separate letters based on
      Message 46 of 46 , Oct 12, 2014
        On Wed, 08 Oct 2014 08:11:34 +0330
        Ali Gholami Rudi <ali.gholami.rudi@...> wrote:

        > I tested it and it is working wonderfully. The only issue is
        > ZWNJ (unicode 0x200c) and ZWJ (unicode 0x200d); I wonder if
        > the letters before and after these characters can be shaped
        > properly...

        For ZWNJ, I did a tiny modification telling `arabic_shape` in one of
        it's invocations, to separate letters based on previously entered ZWNJ
        character. ZWJ could be treated similarly but I doubt with current
        provided letters which are limited to Arabic and Farsi, there could be a
        use case for ZWJ.

        You can apply `zwnj.0.patch` on a recent vim tarball or `zwnj.1.patch`
        on top of your patch.

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      Your message has been successfully submitted and would be delivered to recipients shortly.