8b9a1c
To: vim_dev@googlegroups.com
8b9a1c
Subject: Patch 7.4.088
8b9a1c
Fcc: outbox
8b9a1c
From: Bram Moolenaar <Bram@moolenaar.net>
8b9a1c
Mime-Version: 1.0
8b9a1c
Content-Type: text/plain; charset=UTF-8
8b9a1c
Content-Transfer-Encoding: 8bit
8b9a1c
------------
8b9a1c
8b9a1c
Patch 7.4.088
8b9a1c
Problem:    When spell checking is enabled Asian characters are always marked
8b9a1c
            as error.
8b9a1c
Solution:   When 'spelllang' contains "cjk" do not mark Asian characters as
8b9a1c
            error. (Ken Takata)
8b9a1c
Files:      runtime/doc/options.txt, runtime/doc/spell.txt, src/mbyte.c,
8b9a1c
            src/option.c, src/spell.c, src/structs.h
8b9a1c
8b9a1c
8b9a1c
*** ../vim-7.4.087/runtime/doc/options.txt	2013-11-06 05:26:08.000000000 +0100
8b9a1c
--- runtime/doc/options.txt	2013-11-12 04:00:51.000000000 +0100
8b9a1c
***************
8b9a1c
*** 6555,6560 ****
8b9a1c
--- 6555,6563 ----
8b9a1c
  	region by listing them: "en_us,en_ca" supports both US and Canadian
8b9a1c
  	English, but not words specific for Australia, New Zealand or Great
8b9a1c
  	Britain.
8b9a1c
+ 	If the name "cjk" is included East Asian characters are excluded from
8b9a1c
+ 	spell checking.  This is useful when editing text that also has Asian
8b9a1c
+ 	words.
8b9a1c
  							*E757*
8b9a1c
  	As a special case the name of a .spl file can be given as-is.  The
8b9a1c
  	first "_xx" in the name is removed and used as the region name
8b9a1c
*** ../vim-7.4.087/runtime/doc/spell.txt	2013-08-10 13:25:01.000000000 +0200
8b9a1c
--- runtime/doc/spell.txt	2013-11-12 04:02:27.000000000 +0100
8b9a1c
***************
8b9a1c
*** 269,274 ****
8b9a1c
--- 269,281 ----
8b9a1c
  	latin1		yi		transliterated Yiddish
8b9a1c
  	utf-8		yi-tr		transliterated Yiddish
8b9a1c
  
8b9a1c
+ 							*spell-cjk*
8b9a1c
+ Chinese, Japanese and other East Asian characters are normally marked as
8b9a1c
+ errors, because spell checking of these characters is not supported. If
8b9a1c
+ 'spelllang' includes "cjk", these characters are not marked as errors.  This
8b9a1c
+ is useful when editing text with spell checking while some Asian words are
8b9a1c
+ present.
8b9a1c
+ 
8b9a1c
  
8b9a1c
  SPELL FILES						*spell-load*
8b9a1c
  
8b9a1c
*** ../vim-7.4.087/src/mbyte.c	2013-07-05 20:07:21.000000000 +0200
8b9a1c
--- src/mbyte.c	2013-11-12 03:55:50.000000000 +0100
8b9a1c
***************
8b9a1c
*** 947,954 ****
8b9a1c
  		{
8b9a1c
  		    case 0x2121: /* ZENKAKU space */
8b9a1c
  			return 0;
8b9a1c
! 		    case 0x2122: /* KU-TEN (Japanese comma) */
8b9a1c
! 		    case 0x2123: /* TOU-TEN (Japanese period) */
8b9a1c
  		    case 0x2124: /* ZENKAKU comma */
8b9a1c
  		    case 0x2125: /* ZENKAKU period */
8b9a1c
  			return 1;
8b9a1c
--- 947,954 ----
8b9a1c
  		{
8b9a1c
  		    case 0x2121: /* ZENKAKU space */
8b9a1c
  			return 0;
8b9a1c
! 		    case 0x2122: /* TOU-TEN (Japanese comma) */
8b9a1c
! 		    case 0x2123: /* KU-TEN (Japanese period) */
8b9a1c
  		    case 0x2124: /* ZENKAKU comma */
8b9a1c
  		    case 0x2125: /* ZENKAKU period */
8b9a1c
  			return 1;
8b9a1c
***************
8b9a1c
*** 2477,2485 ****
8b9a1c
      /* sorted list of non-overlapping intervals */
8b9a1c
      static struct clinterval
8b9a1c
      {
8b9a1c
! 	unsigned short first;
8b9a1c
! 	unsigned short last;
8b9a1c
! 	unsigned short class;
8b9a1c
      } classes[] =
8b9a1c
      {
8b9a1c
  	{0x037e, 0x037e, 1},		/* Greek question mark */
8b9a1c
--- 2477,2485 ----
8b9a1c
      /* sorted list of non-overlapping intervals */
8b9a1c
      static struct clinterval
8b9a1c
      {
8b9a1c
! 	unsigned int first;
8b9a1c
! 	unsigned int last;
8b9a1c
! 	unsigned int class;
8b9a1c
      } classes[] =
8b9a1c
      {
8b9a1c
  	{0x037e, 0x037e, 1},		/* Greek question mark */
8b9a1c
***************
8b9a1c
*** 2544,2549 ****
8b9a1c
--- 2544,2553 ----
8b9a1c
  	{0xff1a, 0xff20, 1},		/* half/fullwidth ASCII */
8b9a1c
  	{0xff3b, 0xff40, 1},		/* half/fullwidth ASCII */
8b9a1c
  	{0xff5b, 0xff65, 1},		/* half/fullwidth ASCII */
8b9a1c
+ 	{0x20000, 0x2a6df, 0x4e00},	/* CJK Ideographs */
8b9a1c
+ 	{0x2a700, 0x2b73f, 0x4e00},	/* CJK Ideographs */
8b9a1c
+ 	{0x2b740, 0x2b81f, 0x4e00},	/* CJK Ideographs */
8b9a1c
+ 	{0x2f800, 0x2fa1f, 0x4e00},	/* CJK Ideographs */
8b9a1c
      };
8b9a1c
      int bot = 0;
8b9a1c
      int top = sizeof(classes) / sizeof(struct clinterval) - 1;
8b9a1c
***************
8b9a1c
*** 2563,2571 ****
8b9a1c
      while (top >= bot)
8b9a1c
      {
8b9a1c
  	mid = (bot + top) / 2;
8b9a1c
! 	if (classes[mid].last < c)
8b9a1c
  	    bot = mid + 1;
8b9a1c
! 	else if (classes[mid].first > c)
8b9a1c
  	    top = mid - 1;
8b9a1c
  	else
8b9a1c
  	    return (int)classes[mid].class;
8b9a1c
--- 2567,2575 ----
8b9a1c
      while (top >= bot)
8b9a1c
      {
8b9a1c
  	mid = (bot + top) / 2;
8b9a1c
! 	if (classes[mid].last < (unsigned int)c)
8b9a1c
  	    bot = mid + 1;
8b9a1c
! 	else if (classes[mid].first > (unsigned int)c)
8b9a1c
  	    top = mid - 1;
8b9a1c
  	else
8b9a1c
  	    return (int)classes[mid].class;
8b9a1c
*** ../vim-7.4.087/src/option.c	2013-11-08 04:30:06.000000000 +0100
8b9a1c
--- src/option.c	2013-11-12 04:34:46.000000000 +0100
8b9a1c
***************
8b9a1c
*** 7122,7127 ****
8b9a1c
--- 7122,7132 ----
8b9a1c
  	if (varp == &(curwin->w_s->b_p_spl))
8b9a1c
  	{
8b9a1c
  	    char_u	fname[200];
8b9a1c
+ 	    char_u	*q = curwin->w_s->b_p_spl;
8b9a1c
+ 
8b9a1c
+ 	    /* Skip the first name if it is "cjk". */
8b9a1c
+ 	    if (STRNCMP(q, "cjk,", 4) == 0)
8b9a1c
+ 		q += 4;
8b9a1c
  
8b9a1c
  	    /*
8b9a1c
  	     * Source the spell/LANG.vim in 'runtimepath'.
8b9a1c
***************
8b9a1c
*** 7129,7139 ****
8b9a1c
  	     * Use the first name in 'spelllang' up to '_region' or
8b9a1c
  	     * '.encoding'.
8b9a1c
  	     */
8b9a1c
! 	    for (p = curwin->w_s->b_p_spl; *p != NUL; ++p)
8b9a1c
  		if (vim_strchr((char_u *)"_.,", *p) != NULL)
8b9a1c
  		    break;
8b9a1c
! 	    vim_snprintf((char *)fname, 200, "spell/%.*s.vim",
8b9a1c
! 				 (int)(p - curwin->w_s->b_p_spl), curwin->w_s->b_p_spl);
8b9a1c
  	    source_runtime(fname, TRUE);
8b9a1c
  	}
8b9a1c
  #endif
8b9a1c
--- 7134,7143 ----
8b9a1c
  	     * Use the first name in 'spelllang' up to '_region' or
8b9a1c
  	     * '.encoding'.
8b9a1c
  	     */
8b9a1c
! 	    for (p = q; *p != NUL; ++p)
8b9a1c
  		if (vim_strchr((char_u *)"_.,", *p) != NULL)
8b9a1c
  		    break;
8b9a1c
! 	    vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q);
8b9a1c
  	    source_runtime(fname, TRUE);
8b9a1c
  	}
8b9a1c
  #endif
8b9a1c
*** ../vim-7.4.087/src/spell.c	2013-09-29 13:38:25.000000000 +0200
8b9a1c
--- src/spell.c	2013-11-12 04:37:33.000000000 +0100
8b9a1c
***************
8b9a1c
*** 754,762 ****
8b9a1c
  static void clear_spell_chartab __ARGS((spelltab_T *sp));
8b9a1c
  static int set_spell_finish __ARGS((spelltab_T	*new_st));
8b9a1c
  static int spell_iswordp __ARGS((char_u *p, win_T *wp));
8b9a1c
! static int spell_iswordp_nmw __ARGS((char_u *p));
8b9a1c
  #ifdef FEAT_MBYTE
8b9a1c
! static int spell_mb_isword_class __ARGS((int cl));
8b9a1c
  static int spell_iswordp_w __ARGS((int *p, win_T *wp));
8b9a1c
  #endif
8b9a1c
  static int write_spell_prefcond __ARGS((FILE *fd, garray_T *gap));
8b9a1c
--- 754,762 ----
8b9a1c
  static void clear_spell_chartab __ARGS((spelltab_T *sp));
8b9a1c
  static int set_spell_finish __ARGS((spelltab_T	*new_st));
8b9a1c
  static int spell_iswordp __ARGS((char_u *p, win_T *wp));
8b9a1c
! static int spell_iswordp_nmw __ARGS((char_u *p, win_T *wp));
8b9a1c
  #ifdef FEAT_MBYTE
8b9a1c
! static int spell_mb_isword_class __ARGS((int cl, win_T *wp));
8b9a1c
  static int spell_iswordp_w __ARGS((int *p, win_T *wp));
8b9a1c
  #endif
8b9a1c
  static int write_spell_prefcond __ARGS((FILE *fd, garray_T *gap));
8b9a1c
***************
8b9a1c
*** 1149,1155 ****
8b9a1c
  
8b9a1c
  	/* When we are at a non-word character there is no error, just
8b9a1c
  	 * skip over the character (try looking for a word after it). */
8b9a1c
! 	else if (!spell_iswordp_nmw(ptr))
8b9a1c
  	{
8b9a1c
  	    if (capcol != NULL && wp->w_s->b_cap_prog != NULL)
8b9a1c
  	    {
8b9a1c
--- 1149,1155 ----
8b9a1c
  
8b9a1c
  	/* When we are at a non-word character there is no error, just
8b9a1c
  	 * skip over the character (try looking for a word after it). */
8b9a1c
! 	else if (!spell_iswordp_nmw(ptr, wp))
8b9a1c
  	{
8b9a1c
  	    if (capcol != NULL && wp->w_s->b_cap_prog != NULL)
8b9a1c
  	    {
8b9a1c
***************
8b9a1c
*** 1561,1567 ****
8b9a1c
  			 * accept a no-caps word, even when the dictionary
8b9a1c
  			 * word specifies ONECAP. */
8b9a1c
  			mb_ptr_back(mip->mi_word, p);
8b9a1c
! 			if (spell_iswordp_nmw(p)
8b9a1c
  				? capflags == WF_ONECAP
8b9a1c
  				: (flags & WF_ONECAP) != 0
8b9a1c
  						     && capflags != WF_ONECAP)
8b9a1c
--- 1561,1567 ----
8b9a1c
  			 * accept a no-caps word, even when the dictionary
8b9a1c
  			 * word specifies ONECAP. */
8b9a1c
  			mb_ptr_back(mip->mi_word, p);
8b9a1c
! 			if (spell_iswordp_nmw(p, mip->mi_win)
8b9a1c
  				? capflags == WF_ONECAP
8b9a1c
  				: (flags & WF_ONECAP) != 0
8b9a1c
  						     && capflags != WF_ONECAP)
8b9a1c
***************
8b9a1c
*** 4234,4240 ****
8b9a1c
      if (spl_copy == NULL)
8b9a1c
  	goto theend;
8b9a1c
  
8b9a1c
!     /* loop over comma separated language names. */
8b9a1c
      for (splp = spl_copy; *splp != NUL; )
8b9a1c
      {
8b9a1c
  	/* Get one language name. */
8b9a1c
--- 4234,4242 ----
8b9a1c
      if (spl_copy == NULL)
8b9a1c
  	goto theend;
8b9a1c
  
8b9a1c
!     wp->w_s->b_cjk = 0;
8b9a1c
! 
8b9a1c
!     /* Loop over comma separated language names. */
8b9a1c
      for (splp = spl_copy; *splp != NUL; )
8b9a1c
      {
8b9a1c
  	/* Get one language name. */
8b9a1c
***************
8b9a1c
*** 4242,4247 ****
8b9a1c
--- 4244,4255 ----
8b9a1c
  	region = NULL;
8b9a1c
  	len = (int)STRLEN(lang);
8b9a1c
  
8b9a1c
+ 	if (STRCMP(lang, "cjk") == 0)
8b9a1c
+ 	{
8b9a1c
+ 	    wp->w_s->b_cjk = 1;
8b9a1c
+ 	    continue;
8b9a1c
+ 	}
8b9a1c
+ 
8b9a1c
  	/* If the name ends in ".spl" use it as the name of the spell file.
8b9a1c
  	 * If there is a region name let "region" point to it and remove it
8b9a1c
  	 * from the name. */
8b9a1c
***************
8b9a1c
*** 4601,4607 ****
8b9a1c
      int		past_second = FALSE;	/* past second word char */
8b9a1c
  
8b9a1c
      /* find first letter */
8b9a1c
!     for (p = word; !spell_iswordp_nmw(p); mb_ptr_adv(p))
8b9a1c
  	if (end == NULL ? *p == NUL : p >= end)
8b9a1c
  	    return 0;	    /* only non-word characters, illegal word */
8b9a1c
  #ifdef FEAT_MBYTE
8b9a1c
--- 4609,4615 ----
8b9a1c
      int		past_second = FALSE;	/* past second word char */
8b9a1c
  
8b9a1c
      /* find first letter */
8b9a1c
!     for (p = word; !spell_iswordp_nmw(p, curwin); mb_ptr_adv(p))
8b9a1c
  	if (end == NULL ? *p == NUL : p >= end)
8b9a1c
  	    return 0;	    /* only non-word characters, illegal word */
8b9a1c
  #ifdef FEAT_MBYTE
8b9a1c
***************
8b9a1c
*** 4617,4623 ****
8b9a1c
       * But a word with an upper char only at start is a ONECAP.
8b9a1c
       */
8b9a1c
      for ( ; end == NULL ? *p != NUL : p < end; mb_ptr_adv(p))
8b9a1c
! 	if (spell_iswordp_nmw(p))
8b9a1c
  	{
8b9a1c
  	    c = PTR2CHAR(p);
8b9a1c
  	    if (!SPELL_ISUPPER(c))
8b9a1c
--- 4625,4631 ----
8b9a1c
       * But a word with an upper char only at start is a ONECAP.
8b9a1c
       */
8b9a1c
      for ( ; end == NULL ? *p != NUL : p < end; mb_ptr_adv(p))
8b9a1c
! 	if (spell_iswordp_nmw(p, curwin))
8b9a1c
  	{
8b9a1c
  	    c = PTR2CHAR(p);
8b9a1c
  	    if (!SPELL_ISUPPER(c))
8b9a1c
***************
8b9a1c
*** 9907,9913 ****
8b9a1c
  
8b9a1c
  	c = mb_ptr2char(s);
8b9a1c
  	if (c > 255)
8b9a1c
! 	    return spell_mb_isword_class(mb_get_class(s));
8b9a1c
  	return spelltab.st_isw[c];
8b9a1c
      }
8b9a1c
  #endif
8b9a1c
--- 9915,9921 ----
8b9a1c
  
8b9a1c
  	c = mb_ptr2char(s);
8b9a1c
  	if (c > 255)
8b9a1c
! 	    return spell_mb_isword_class(mb_get_class(s), wp);
8b9a1c
  	return spelltab.st_isw[c];
8b9a1c
      }
8b9a1c
  #endif
8b9a1c
***************
8b9a1c
*** 9920,9927 ****
8b9a1c
   * Unlike spell_iswordp() this doesn't check for "midword" characters.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! spell_iswordp_nmw(p)
8b9a1c
      char_u	*p;
8b9a1c
  {
8b9a1c
  #ifdef FEAT_MBYTE
8b9a1c
      int		c;
8b9a1c
--- 9928,9936 ----
8b9a1c
   * Unlike spell_iswordp() this doesn't check for "midword" characters.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! spell_iswordp_nmw(p, wp)
8b9a1c
      char_u	*p;
8b9a1c
+     win_T	*wp;
8b9a1c
  {
8b9a1c
  #ifdef FEAT_MBYTE
8b9a1c
      int		c;
8b9a1c
***************
8b9a1c
*** 9930,9936 ****
8b9a1c
      {
8b9a1c
  	c = mb_ptr2char(p);
8b9a1c
  	if (c > 255)
8b9a1c
! 	    return spell_mb_isword_class(mb_get_class(p));
8b9a1c
  	return spelltab.st_isw[c];
8b9a1c
      }
8b9a1c
  #endif
8b9a1c
--- 9939,9945 ----
8b9a1c
      {
8b9a1c
  	c = mb_ptr2char(p);
8b9a1c
  	if (c > 255)
8b9a1c
! 	    return spell_mb_isword_class(mb_get_class(p), wp);
8b9a1c
  	return spelltab.st_isw[c];
8b9a1c
      }
8b9a1c
  #endif
8b9a1c
***************
8b9a1c
*** 9942,9952 ****
8b9a1c
   * Return TRUE if word class indicates a word character.
8b9a1c
   * Only for characters above 255.
8b9a1c
   * Unicode subscript and superscript are not considered word characters.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! spell_mb_isword_class(cl)
8b9a1c
!     int cl;
8b9a1c
  {
8b9a1c
      return cl >= 2 && cl != 0x2070 && cl != 0x2080;
8b9a1c
  }
8b9a1c
  
8b9a1c
--- 9951,9966 ----
8b9a1c
   * Return TRUE if word class indicates a word character.
8b9a1c
   * Only for characters above 255.
8b9a1c
   * Unicode subscript and superscript are not considered word characters.
8b9a1c
+  * See also dbcs_class() and utf_class() in mbyte.c.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! spell_mb_isword_class(cl, wp)
8b9a1c
!     int		cl;
8b9a1c
!     win_T	*wp;
8b9a1c
  {
8b9a1c
+     if (wp->w_s->b_cjk)
8b9a1c
+ 	/* East Asian characters are not considered word characters. */
8b9a1c
+ 	return cl == 2 || cl == 0x2800;
8b9a1c
      return cl >= 2 && cl != 0x2070 && cl != 0x2080;
8b9a1c
  }
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 9971,9979 ****
8b9a1c
      if (*s > 255)
8b9a1c
      {
8b9a1c
  	if (enc_utf8)
8b9a1c
! 	    return spell_mb_isword_class(utf_class(*s));
8b9a1c
  	if (enc_dbcs)
8b9a1c
! 	    return dbcs_class((unsigned)*s >> 8, *s & 0xff) >= 2;
8b9a1c
  	return 0;
8b9a1c
      }
8b9a1c
      return spelltab.st_isw[*s];
8b9a1c
--- 9985,9994 ----
8b9a1c
      if (*s > 255)
8b9a1c
      {
8b9a1c
  	if (enc_utf8)
8b9a1c
! 	    return spell_mb_isword_class(utf_class(*s), wp);
8b9a1c
  	if (enc_dbcs)
8b9a1c
! 	    return spell_mb_isword_class(
8b9a1c
! 				dbcs_class((unsigned)*s >> 8, *s & 0xff), wp);
8b9a1c
  	return 0;
8b9a1c
      }
8b9a1c
      return spelltab.st_isw[*s];
8b9a1c
***************
8b9a1c
*** 10193,10205 ****
8b9a1c
  	line = ml_get_curline();
8b9a1c
  	p = line + curwin->w_cursor.col;
8b9a1c
  	/* Backup to before start of word. */
8b9a1c
! 	while (p > line && spell_iswordp_nmw(p))
8b9a1c
  	    mb_ptr_back(line, p);
8b9a1c
  	/* Forward to start of word. */
8b9a1c
! 	while (*p != NUL && !spell_iswordp_nmw(p))
8b9a1c
  	    mb_ptr_adv(p);
8b9a1c
  
8b9a1c
! 	if (!spell_iswordp_nmw(p))		/* No word found. */
8b9a1c
  	{
8b9a1c
  	    beep_flush();
8b9a1c
  	    return;
8b9a1c
--- 10208,10220 ----
8b9a1c
  	line = ml_get_curline();
8b9a1c
  	p = line + curwin->w_cursor.col;
8b9a1c
  	/* Backup to before start of word. */
8b9a1c
! 	while (p > line && spell_iswordp_nmw(p, curwin))
8b9a1c
  	    mb_ptr_back(line, p);
8b9a1c
  	/* Forward to start of word. */
8b9a1c
! 	while (*p != NUL && !spell_iswordp_nmw(p, curwin))
8b9a1c
  	    mb_ptr_adv(p);
8b9a1c
  
8b9a1c
! 	if (!spell_iswordp_nmw(p, curwin))		/* No word found. */
8b9a1c
  	{
8b9a1c
  	    beep_flush();
8b9a1c
  	    return;
8b9a1c
***************
8b9a1c
*** 10436,10442 ****
8b9a1c
  	for (;;)
8b9a1c
  	{
8b9a1c
  	    mb_ptr_back(line, p);
8b9a1c
! 	    if (p == line || spell_iswordp_nmw(p))
8b9a1c
  		break;
8b9a1c
  	    if (vim_regexec(&regmatch, p, 0)
8b9a1c
  					 && regmatch.endp[0] == line + endcol)
8b9a1c
--- 10451,10457 ----
8b9a1c
  	for (;;)
8b9a1c
  	{
8b9a1c
  	    mb_ptr_back(line, p);
8b9a1c
! 	    if (p == line || spell_iswordp_nmw(p, curwin))
8b9a1c
  		break;
8b9a1c
  	    if (vim_regexec(&regmatch, p, 0)
8b9a1c
  					 && regmatch.endp[0] == line + endcol)
8b9a1c
***************
8b9a1c
*** 11645,11651 ****
8b9a1c
  
8b9a1c
  		/* When appending a compound word after a word character don't
8b9a1c
  		 * use Onecap. */
8b9a1c
! 		if (p != NULL && spell_iswordp_nmw(p))
8b9a1c
  		    c &= ~WF_ONECAP;
8b9a1c
  		make_case_word(tword + sp->ts_splitoff,
8b9a1c
  					      preword + sp->ts_prewordlen, c);
8b9a1c
--- 11660,11666 ----
8b9a1c
  
8b9a1c
  		/* When appending a compound word after a word character don't
8b9a1c
  		 * use Onecap. */
8b9a1c
! 		if (p != NULL && spell_iswordp_nmw(p, curwin))
8b9a1c
  		    c &= ~WF_ONECAP;
8b9a1c
  		make_case_word(tword + sp->ts_splitoff,
8b9a1c
  					      preword + sp->ts_prewordlen, c);
8b9a1c
***************
8b9a1c
*** 11895,11901 ****
8b9a1c
  			 * character when the word ends.  But only when the
8b9a1c
  			 * good word can end. */
8b9a1c
  			if (((!try_compound && !spell_iswordp_nmw(fword
8b9a1c
! 							       + sp->ts_fidx))
8b9a1c
  				    || fword_ends)
8b9a1c
  				&& fword[sp->ts_fidx] != NUL
8b9a1c
  				&& goodword_ends)
8b9a1c
--- 11910,11917 ----
8b9a1c
  			 * character when the word ends.  But only when the
8b9a1c
  			 * good word can end. */
8b9a1c
  			if (((!try_compound && !spell_iswordp_nmw(fword
8b9a1c
! 							       + sp->ts_fidx,
8b9a1c
! 							       curwin))
8b9a1c
  				    || fword_ends)
8b9a1c
  				&& fword[sp->ts_fidx] != NUL
8b9a1c
  				&& goodword_ends)
8b9a1c
***************
8b9a1c
*** 14226,14232 ****
8b9a1c
  	    }
8b9a1c
  	    else
8b9a1c
  	    {
8b9a1c
! 		if (spell_iswordp_nmw(s))
8b9a1c
  		    *t++ = *s;
8b9a1c
  		++s;
8b9a1c
  	    }
8b9a1c
--- 14242,14248 ----
8b9a1c
  	    }
8b9a1c
  	    else
8b9a1c
  	    {
8b9a1c
! 		if (spell_iswordp_nmw(s, curwin))
8b9a1c
  		    *t++ = *s;
8b9a1c
  		++s;
8b9a1c
  	    }
8b9a1c
***************
8b9a1c
*** 14521,14527 ****
8b9a1c
  	    else
8b9a1c
  	    {
8b9a1c
  		did_white = FALSE;
8b9a1c
! 		if (!spell_iswordp_nmw(t))
8b9a1c
  		    continue;
8b9a1c
  	    }
8b9a1c
  	}
8b9a1c
--- 14537,14543 ----
8b9a1c
  	    else
8b9a1c
  	    {
8b9a1c
  		did_white = FALSE;
8b9a1c
! 		if (!spell_iswordp_nmw(t, curwin))
8b9a1c
  		    continue;
8b9a1c
  	    }
8b9a1c
  	}
8b9a1c
***************
8b9a1c
*** 16045,16051 ****
8b9a1c
      for (p = line + startcol; p > line; )
8b9a1c
      {
8b9a1c
  	mb_ptr_back(line, p);
8b9a1c
! 	if (spell_iswordp_nmw(p))
8b9a1c
  	    break;
8b9a1c
      }
8b9a1c
  
8b9a1c
--- 16061,16067 ----
8b9a1c
      for (p = line + startcol; p > line; )
8b9a1c
      {
8b9a1c
  	mb_ptr_back(line, p);
8b9a1c
! 	if (spell_iswordp_nmw(p, curwin))
8b9a1c
  	    break;
8b9a1c
      }
8b9a1c
  
8b9a1c
*** ../vim-7.4.087/src/structs.h	2013-11-09 05:30:18.000000000 +0100
8b9a1c
--- src/structs.h	2013-11-12 03:55:50.000000000 +0100
8b9a1c
***************
8b9a1c
*** 1310,1315 ****
8b9a1c
--- 1310,1318 ----
8b9a1c
      regprog_T	*b_cap_prog;	/* program for 'spellcapcheck' */
8b9a1c
      char_u	*b_p_spf;	/* 'spellfile' */
8b9a1c
      char_u	*b_p_spl;	/* 'spelllang' */
8b9a1c
+ # ifdef FEAT_MBYTE
8b9a1c
+     int		b_cjk;		/* all CJK letters as OK */
8b9a1c
+ # endif
8b9a1c
  #endif
8b9a1c
  #if !defined(FEAT_SYN_HL) && !defined(FEAT_SPELL)
8b9a1c
      int		dummy;
8b9a1c
*** ../vim-7.4.087/src/version.c	2013-11-11 23:17:31.000000000 +0100
8b9a1c
--- src/version.c	2013-11-12 03:59:03.000000000 +0100
8b9a1c
***************
8b9a1c
*** 740,741 ****
8b9a1c
--- 740,743 ----
8b9a1c
  {   /* Add new patch number below this line */
8b9a1c
+ /**/
8b9a1c
+     88,
8b9a1c
  /**/
8b9a1c
8b9a1c
-- 
8b9a1c
THEOREM: VI is perfect.
8b9a1c
PROOF: VI in roman numerals is 6.  The natural numbers < 6 which divide 6 are
8b9a1c
1, 2, and 3. 1+2+3 = 6.  So 6 is a perfect number.  Therefore, VI is perfect.
8b9a1c
QED
8b9a1c
						    -- Arthur Tateishi
8b9a1c
8b9a1c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8b9a1c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8b9a1c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8b9a1c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///