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

Patch for 6.0k for double-byte characters

Expand Messages
  • Bram Moolenaar
    DBCS (double-byte) characters aren t handled properly in 6.0k. This patch should fix it: ... *************** *** 85,93 **** /* UTF-8: can t tell width from
    Message 1 of 1 , Oct 30, 2000
      DBCS (double-byte) characters aren't handled properly in 6.0k. This patch
      should fix it:

      *** ../dist/vim60k/src/charset.c Sat Oct 28 14:38:22 2000
      --- charset.c Mon Oct 30 14:32:32 2000
      ***************
      *** 85,93 ****
      /* UTF-8: can't tell width from first byte unless it's ASCII */
      if (cc_utf8 && c >= 0xa0)
      chartab[c++] = CT_PRINT_CHAR + 1;
      ! /* double-byte chars are either unprintable or double-width */
      else if (cc_dbcs && MB_BYTE2LEN(c) == 2)
      ! chartab[c++] = 2;
      else
      #endif
      /* the rest is unprintable by default */
      --- 94,102 ----
      /* UTF-8: can't tell width from first byte unless it's ASCII */
      if (cc_utf8 && c >= 0xa0)
      chartab[c++] = CT_PRINT_CHAR + 1;
      ! /* double-byte chars can be printable AND double-width */
      else if (cc_dbcs && MB_BYTE2LEN(c) == 2)
      ! chartab[c++] = CT_PRINT_CHAR + 2;
      else
      #endif
      /* the rest is unprintable by default */
      ***************
      *** 198,212 ****
      }
      else if (i == 1) /* (re)set printable */
      {
      ! if (c < ' '
      #ifndef EBCDIC
      ! || c > '~'
      #endif
      #ifdef FEAT_FKMAP
      ! || (p_altkeymap
      ! && (F_isalpha(c) || F_isdigit(c)))
      #endif
      )
      {
      if (tilde)
      {
      --- 207,227 ----
      }
      else if (i == 1) /* (re)set printable */
      {
      ! if ((c < ' '
      #ifndef EBCDIC
      ! || c > '~'
      #endif
      #ifdef FEAT_FKMAP
      ! || (p_altkeymap
      ! && (F_isalpha(c) || F_isdigit(c)))
      #endif
      )
      + #ifdef FEAT_MBYTE
      + /* For double-byte we keep the cell width, so
      + * that we can detect it from the first byte. */
      + && !(cc_dbcs && MB_BYTE2LEN(c) == 2)
      + #endif
      + )
      {
      if (tilde)
      {


      --
      The acknowledged parents of reengineering are Michael Hammer and James Champy.
      When I say they're the "parents" I don't mean they had sex - and I apologize
      for making you think about it. I mean they wrote the best-selling business
      book _Reengineering the Corporation_, which was published in 1993.
      Businesses flocked to reengineering like frat boys to a drunken
      cheerleader. (This anology wasn't necessary, but I'm trying to get my mind
      off that Hammer and Champy thing.)
      (Scott Adams - The Dilbert principle)

      /// 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.