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