home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.267 < prev    next >
Encoding:
Internet Message Format  |  2002-02-21  |  2.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.267
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.267
  11. Problem:    UTF-8: Although 'isprint' says a character is printable,
  12.         utf_char2cells() still considers it unprintable.
  13. Solution:   Use vim_isprintc() for characters upto 0x100. (Yasuhiro Matsumoto)
  14. Files:        src/mbyte.c
  15.  
  16.  
  17. *** ../vim60.266/src/mbyte.c    Fri Feb 22 17:03:56 2002
  18. --- src/mbyte.c    Fri Feb 22 20:47:59 2002
  19. ***************
  20. *** 914,929 ****
  21.   
  22.   /*
  23.    * For UTF-8 character "c" return 2 for a double-width character, 1 for others.
  24.    */
  25.       int
  26.   utf_char2cells(c)
  27.       int        c;
  28.   {
  29. !     if (c <= 0x9f && c >= 0x80)        /* unprintable, displays <xx> */
  30. !     return 4;
  31. !     if (c >= 0x100 && !utf_printable(c))
  32. !     return 6;            /* unprintable, displays <xxxx> */
  33. !     if (c >= 0x1100
  34.           && (c <= 0x115f            /* Hangul Jamo */
  35.           || (c >= 0x2e80 && c <= 0xa4cf && (c & ~0x0011) != 0x300a
  36.               && c != 0x303f)        /* CJK ... Yi */
  37. --- 914,931 ----
  38.   
  39.   /*
  40.    * For UTF-8 character "c" return 2 for a double-width character, 1 for others.
  41. +  * Returns 4 or 6 for an unprintable character.
  42. +  * Is only correct for characters >= 0x80.
  43.    */
  44.       int
  45.   utf_char2cells(c)
  46.       int        c;
  47.   {
  48. !     if (c >= 0x100)
  49. !     {
  50. !     if (!utf_printable(c))
  51. !         return 6;        /* unprintable, displays <xxxx> */
  52. !     if (c >= 0x1100
  53.           && (c <= 0x115f            /* Hangul Jamo */
  54.           || (c >= 0x2e80 && c <= 0xa4cf && (c & ~0x0011) != 0x300a
  55.               && c != 0x303f)        /* CJK ... Yi */
  56. ***************
  57. *** 934,940 ****
  58.           || (c >= 0xff00 && c <= 0xff5f)    /* Fullwidth Forms */
  59.           || (c >= 0xffe0 && c <= 0xffe6)
  60.           || (c >= 0x20000 && c <= 0x2ffff)))
  61. !     return 2;
  62.       return 1;
  63.   }
  64.   
  65. --- 936,948 ----
  66.           || (c >= 0xff00 && c <= 0xff5f)    /* Fullwidth Forms */
  67.           || (c >= 0xffe0 && c <= 0xffe6)
  68.           || (c >= 0x20000 && c <= 0x2ffff)))
  69. !         return 2;
  70. !     }
  71. !     /* Characters below 0x100 are influenced by 'isprint' option */
  72. !     else if (!vim_isprintc(c))
  73. !     return 4;        /* unprintable, displays <xx> */
  74.       return 1;
  75.   }
  76.   
  77. *** ../vim60.266/src/version.c    Fri Feb 22 20:33:16 2002
  78. --- src/version.c    Fri Feb 22 20:44:12 2002
  79. ***************
  80. *** 608,609 ****
  81. --- 608,611 ----
  82.   {   /* Add new patch number below this line */
  83. + /**/
  84. +     267,
  85.   /**/
  86.  
  87. -- 
  88. hundred-and-one symptoms of being an internet addict:
  89. 5. You find yourself brainstorming for new subjects to search.
  90.  
  91.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  92. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  93. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  94.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  95.