dcaee6
To: vim_dev@googlegroups.com
dcaee6
Subject: Patch 7.4.038
dcaee6
Fcc: outbox
dcaee6
From: Bram Moolenaar <Bram@moolenaar.net>
dcaee6
Mime-Version: 1.0
dcaee6
Content-Type: text/plain; charset=UTF-8
dcaee6
Content-Transfer-Encoding: 8bit
dcaee6
------------
dcaee6
dcaee6
Patch 7.4.038
dcaee6
Problem:    Using "zw" and "zg" when 'spell' is off give a confusing error
dcaee6
	    message. (Gary Johnson)
dcaee6
Solution:   Ignore the error when locating the word.  Explicitly mention what
dcaee6
	    word was added. (Christian Brabandt)
dcaee6
Files:	    src/normal.c, src/spell.c
dcaee6
dcaee6
dcaee6
*** ../vim-7.4.037/src/normal.c	2013-09-22 15:23:38.000000000 +0200
dcaee6
--- src/normal.c	2013-09-25 18:54:08.000000000 +0200
dcaee6
***************
dcaee6
*** 5246,5253 ****
dcaee6
  		    {
dcaee6
  			pos_T	pos = curwin->w_cursor;
dcaee6
  
dcaee6
! 			/* Find bad word under the cursor. */
dcaee6
  			len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL);
dcaee6
  			if (len != 0 && curwin->w_cursor.col <= pos.col)
dcaee6
  			    ptr = ml_get_pos(&curwin->w_cursor);
dcaee6
  			curwin->w_cursor = pos;
dcaee6
--- 5246,5257 ----
dcaee6
  		    {
dcaee6
  			pos_T	pos = curwin->w_cursor;
dcaee6
  
dcaee6
! 			/* Find bad word under the cursor.  When 'spell' is
dcaee6
! 			 * off this fails and find_ident_under_cursor() is
dcaee6
! 			 * used below. */
dcaee6
! 			emsg_off++;
dcaee6
  			len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL);
dcaee6
+ 			emsg_off--;
dcaee6
  			if (len != 0 && curwin->w_cursor.col <= pos.col)
dcaee6
  			    ptr = ml_get_pos(&curwin->w_cursor);
dcaee6
  			curwin->w_cursor = pos;
dcaee6
*** ../vim-7.4.037/src/spell.c	2013-07-17 17:28:28.000000000 +0200
dcaee6
--- src/spell.c	2013-09-25 18:48:55.000000000 +0200
dcaee6
***************
dcaee6
*** 9479,9485 ****
dcaee6
  			if (undo)
dcaee6
  			{
dcaee6
  			    home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
dcaee6
! 			    smsg((char_u *)_("Word removed from %s"), NameBuff);
dcaee6
  			}
dcaee6
  		    }
dcaee6
  		    fseek(fd, fpos_next, SEEK_SET);
dcaee6
--- 9479,9486 ----
dcaee6
  			if (undo)
dcaee6
  			{
dcaee6
  			    home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
dcaee6
! 			    smsg((char_u *)_("Word '%.*s' removed from %s"),
dcaee6
! 							 len, word, NameBuff);
dcaee6
  			}
dcaee6
  		    }
dcaee6
  		    fseek(fd, fpos_next, SEEK_SET);
dcaee6
***************
dcaee6
*** 9525,9531 ****
dcaee6
  	    fclose(fd);
dcaee6
  
dcaee6
  	    home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
dcaee6
! 	    smsg((char_u *)_("Word added to %s"), NameBuff);
dcaee6
  	}
dcaee6
      }
dcaee6
  
dcaee6
--- 9526,9532 ----
dcaee6
  	    fclose(fd);
dcaee6
  
dcaee6
  	    home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
dcaee6
! 	    smsg((char_u *)_("Word '%.*s' added to %s"), len, word, NameBuff);
dcaee6
  	}
dcaee6
      }
dcaee6
  
dcaee6
***************
dcaee6
*** 10135,10141 ****
dcaee6
  }
dcaee6
  
dcaee6
  /*
dcaee6
!  * "z?": Find badly spelled word under or after the cursor.
dcaee6
   * Give suggestions for the properly spelled word.
dcaee6
   * In Visual mode use the highlighted word as the bad word.
dcaee6
   * When "count" is non-zero use that suggestion.
dcaee6
--- 10136,10142 ----
dcaee6
  }
dcaee6
  
dcaee6
  /*
dcaee6
!  * "z=": Find badly spelled word under or after the cursor.
dcaee6
   * Give suggestions for the properly spelled word.
dcaee6
   * In Visual mode use the highlighted word as the bad word.
dcaee6
   * When "count" is non-zero use that suggestion.
dcaee6
*** ../vim-7.4.037/src/version.c	2013-09-25 18:16:34.000000000 +0200
dcaee6
--- src/version.c	2013-09-25 18:52:47.000000000 +0200
dcaee6
***************
dcaee6
*** 740,741 ****
dcaee6
--- 740,743 ----
dcaee6
  {   /* Add new patch number below this line */
dcaee6
+ /**/
dcaee6
+     38,
dcaee6
  /**/
dcaee6
dcaee6
-- 
dcaee6
MAN:    Fetchez la vache!
dcaee6
GUARD:  Quoi?
dcaee6
MAN:    Fetchez la vache!
dcaee6
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
dcaee6
dcaee6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
dcaee6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
dcaee6
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
dcaee6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///