lkundrak / rpms / vim

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