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