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 / 7.1 / 7.1.293 < prev    next >
Encoding:
Internet Message Format  |  2008-04-08  |  3.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.1.293
  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 7.1.293
  11. Problem:    Spell checking considers super- and subscript characters as word
  12.         characters.
  13. Solution:   Recognize the Unicode super and subscript characters.
  14. Files:        src/spell.c
  15.  
  16.  
  17. *** ../vim-7.1.292/src/spell.c    Tue Apr  1 17:13:54 2008
  18. --- src/spell.c    Wed Apr  9 15:47:06 2008
  19. ***************
  20. *** 753,758 ****
  21. --- 753,759 ----
  22.   static int spell_iswordp __ARGS((char_u *p, buf_T *buf));
  23.   static int spell_iswordp_nmw __ARGS((char_u *p));
  24.   #ifdef FEAT_MBYTE
  25. + static int spell_mb_isword_class __ARGS((int cl));
  26.   static int spell_iswordp_w __ARGS((int *p, buf_T *buf));
  27.   #endif
  28.   static int write_spell_prefcond __ARGS((FILE *fd, garray_T *gap));
  29. ***************
  30. *** 9789,9795 ****
  31.   
  32.       c = mb_ptr2char(s);
  33.       if (c > 255)
  34. !         return mb_get_class(s) >= 2;
  35.       return spelltab.st_isw[c];
  36.       }
  37.   #endif
  38. --- 9790,9796 ----
  39.   
  40.       c = mb_ptr2char(s);
  41.       if (c > 255)
  42. !         return spell_mb_isword_class(mb_get_class(s));
  43.       return spelltab.st_isw[c];
  44.       }
  45.   #endif
  46. ***************
  47. *** 9812,9818 ****
  48.       {
  49.       c = mb_ptr2char(p);
  50.       if (c > 255)
  51. !         return mb_get_class(p) >= 2;
  52.       return spelltab.st_isw[c];
  53.       }
  54.   #endif
  55. --- 9813,9819 ----
  56.       {
  57.       c = mb_ptr2char(p);
  58.       if (c > 255)
  59. !         return spell_mb_isword_class(mb_get_class(p));
  60.       return spelltab.st_isw[c];
  61.       }
  62.   #endif
  63. ***************
  64. *** 9821,9826 ****
  65. --- 9822,9839 ----
  66.   
  67.   #ifdef FEAT_MBYTE
  68.   /*
  69. +  * Return TRUE if word class indicates a word character.
  70. +  * Only for characters above 255.
  71. +  * Unicode subscript and superscript are not considered word characters.
  72. +  */
  73. +     static int
  74. + spell_mb_isword_class(cl)
  75. +     int cl;
  76. + {
  77. +     return cl >= 2 && cl != 0x2070 && cl != 0x2080;
  78. + }
  79. + /*
  80.    * Return TRUE if "p" points to a word character.
  81.    * Wide version of spell_iswordp().
  82.    */
  83. ***************
  84. *** 9841,9847 ****
  85.       if (*s > 255)
  86.       {
  87.       if (enc_utf8)
  88. !         return utf_class(*s) >= 2;
  89.       if (enc_dbcs)
  90.           return dbcs_class((unsigned)*s >> 8, *s & 0xff) >= 2;
  91.       return 0;
  92. --- 9854,9860 ----
  93.       if (*s > 255)
  94.       {
  95.       if (enc_utf8)
  96. !         return spell_mb_isword_class(utf_class(*s));
  97.       if (enc_dbcs)
  98.           return dbcs_class((unsigned)*s >> 8, *s & 0xff) >= 2;
  99.       return 0;
  100. *** ../vim-7.1.292/src/version.c    Wed Apr  9 12:14:44 2008
  101. --- src/version.c    Wed Apr  9 15:45:10 2008
  102. ***************
  103. *** 668,669 ****
  104. --- 673,676 ----
  105.   {   /* Add new patch number below this line */
  106. + /**/
  107. +     293,
  108.   /**/
  109.  
  110. -- 
  111. hundred-and-one symptoms of being an internet addict:
  112. 268. You get up in the morning and go online before getting your coffee.
  113.  
  114.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  115. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  116. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  117.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  118.