efda68b
To: vim-dev@vim.org
efda68b
Subject: patch 7.1.057
efda68b
Fcc: outbox
efda68b
From: Bram Moolenaar <Bram@moolenaar.net>
efda68b
Mime-Version: 1.0
efda68b
Content-Type: text/plain; charset=ISO-8859-1
efda68b
Content-Transfer-Encoding: 8bit
efda68b
------------
efda68b
efda68b
Patch 7.1.057
efda68b
Problem:    Problem with CursorHoldI when using "r" in Visual mode (Max
efda68b
            Dyckhoff)
efda68b
Solution:   Ignore CursorHold(I) when getting a second character for a Normal
efda68b
            mode command.  Also abort the "r" command in Visual when a special
efda68b
            key is typed.
efda68b
Files:      src/normal.c
efda68b
efda68b
efda68b
*** ../vim-7.1.056/src/normal.c	Tue Jul 10 14:02:51 2007
efda68b
--- src/normal.c	Sun Aug  5 21:57:43 2007
efda68b
***************
efda68b
*** 889,894 ****
efda68b
--- 889,899 ----
efda68b
  
efda68b
  	++no_mapping;
efda68b
  	++allow_keys;		/* no mapping for nchar, but allow key codes */
efda68b
+ #ifdef FEAT_AUTOCMD
efda68b
+ 	/* Don't generate a CursorHold event here, most commands can't handle
efda68b
+ 	 * it, e.g., nv_replace(), nv_csearch(). */
efda68b
+ 	did_cursorhold = TRUE;
efda68b
+ #endif
efda68b
  	if (ca.cmdchar == 'g')
efda68b
  	{
efda68b
  	    /*
efda68b
***************
efda68b
*** 6662,6667 ****
efda68b
--- 6668,6680 ----
efda68b
      else
efda68b
  	had_ctrl_v = NUL;
efda68b
  
efda68b
+     /* Abort if the character is a special key. */
efda68b
+     if (IS_SPECIAL(cap->nchar))
efda68b
+     {
efda68b
+ 	clearopbeep(cap->oap);
efda68b
+ 	return;
efda68b
+     }
efda68b
+ 
efda68b
  #ifdef FEAT_VISUAL
efda68b
      /* Visual mode "r" */
efda68b
      if (VIsual_active)
efda68b
***************
efda68b
*** 6688,6698 ****
efda68b
      }
efda68b
  #endif
efda68b
  
efda68b
!     /*
efda68b
!      * Check for a special key or not enough characters to replace.
efda68b
!      */
efda68b
      ptr = ml_get_cursor();
efda68b
!     if (IS_SPECIAL(cap->nchar) || STRLEN(ptr) < (unsigned)cap->count1
efda68b
  #ifdef FEAT_MBYTE
efda68b
  	    || (has_mbyte && mb_charlen(ptr) < cap->count1)
efda68b
  #endif
efda68b
--- 6701,6709 ----
efda68b
      }
efda68b
  #endif
efda68b
  
efda68b
!     /* Abort if not enough characters to replace. */
efda68b
      ptr = ml_get_cursor();
efda68b
!     if (STRLEN(ptr) < (unsigned)cap->count1
efda68b
  #ifdef FEAT_MBYTE
efda68b
  	    || (has_mbyte && mb_charlen(ptr) < cap->count1)
efda68b
  #endif
efda68b
*** ../vim-7.1.056/src/version.c	Tue Aug  7 21:59:26 2007
efda68b
--- src/version.c	Wed Aug  8 21:39:43 2007
efda68b
***************
efda68b
*** 668,669 ****
efda68b
--- 668,671 ----
efda68b
  {   /* Add new patch number below this line */
efda68b
+ /**/
efda68b
+     57,
efda68b
  /**/
efda68b
efda68b
-- 
efda68b
hundred-and-one symptoms of being an internet addict:
efda68b
95. Only communication in your household is through email.
efda68b
efda68b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
efda68b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
efda68b
\\\        download, build and distribute -- http://www.A-A-P.org        ///
efda68b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///