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

Re: patch for vim 6.0b - search.c

Expand Messages
  • Chong-Dae Park
    OOPS.. There is a BUG!!! The behavior of gchar_cursor() is changed from 5.X to 6.0. So, cls() does not work correctly for Japanese, TOO. This is a newer patch.
    Message 1 of 3 , Jul 17, 2000
    • 0 Attachment
      OOPS.. There is a BUG!!!
      The behavior of gchar_cursor() is changed from 5.X to 6.0.
      So, cls() does not work correctly for Japanese, TOO.

      This is a newer patch. Pleas test and apply it.

      --- search.c.orig Mon Jul 17 21:43:57 2000
      +++ search.c Mon Jul 17 22:20:33 2000
      @@ -2186,8 +2186,8 @@
      if (cc_dbcs && c > 0xFF)
      {
      /* process code leading/trailing bytes */
      - unsigned char c1 = c & 0xff;
      - unsigned char c2 = (unsigned)c >> 8;
      + unsigned char c1 = (unsigned)c >> 8;
      + unsigned char c2 = c & 0xff;

      if (cc_dbcs == (int)DBCS_JPN)
      {
      @@ -2265,7 +2265,6 @@
      }
      else if (cc_dbcs == (int)DBCS_KOR)
      {
      - /* TODO: this code has been reported not to work correctly! */
      /*
      * If stype is non-zero, report these as class 1.
      */
      @@ -2291,6 +2290,14 @@
      if (c1 >= 0xB0 && c1 <= 0xC8)
      /* Hangul */
      return 20;
      +#ifdef WIN32
      + else if (c1 <= 0xA0 || c2 <= 0xA0)
      + /* Extended Hangul Region : MS UHC(Unified Hangul Code) */
      + /* c1: 0x81-0xA0 with c2: 0x41-0x5A, 0x61-0x7A, 0x81-0xFE
      + * c1: 0xA1-0xC6 with c2: 0x41-0x5A, 0x61-0x7A, 0x81-0xA0
      + */
      + return 20;
      +#endif
      else if (c1 >= 0xCA && c1 <= 0xFD)
      /* Hanja */
      return 21;
      @@ -2332,11 +2339,6 @@
      /* Cyrillic Letter */
      return 30;
      }
      -#ifdef WIN32
      - if (c1 >= 0x81 && (c1 <= 0xA0 || c2 <= 0xA0))
      - /* Extended Hangul Region : MS UHC(Unified Hangul Code) */
      - return 20;
      -#endif
      }
      return 3;
      }


      --
      Chong-Dae Park
      --
      Han Solo: That's 'cause droids don't pull people's arms out of their sockets
      when they lose. Wookiees are known to do that.
      C-3PO: I see your point, sir. I suggest a new strategy, R2! let the Wookiee
      win.
      - from "Star Wars: A New Hope"
    • Bram Moolenaar
      ... Thanks, I ll include it. I m glad that you also found the problem of swapping c1 and c2. There was a mixup of using the leading byte as MSB or LSB in an
      Message 2 of 3 , Jul 17, 2000
      • 0 Attachment
        Chong-Dae Park wrote:

        > This is patch for vim-6.0b.
        > The code included in vim-6.0b is a buggy one.
        > (Sorry, Bram. That's my fault.)

        Thanks, I'll include it.

        I'm glad that you also found the problem of swapping c1 and c2. There was a
        mixup of using the leading byte as MSB or LSB in an int. I now always use the
        leading byte as MSB. Perhaps there is still some place where it isn't. Let
        me know if you find one.

        --
        MESKIMEN'S LAW
        There's never time to do it right, but always time to do it over.

        /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
        \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
      Your message has been successfully submitted and would be delivered to recipients shortly.