Karsten Hopp 9c3490
To: vim-dev@vim.org
Karsten Hopp 9c3490
Subject: Patch 7.1.241
Karsten Hopp 9c3490
Fcc: outbox
Karsten Hopp 9c3490
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 9c3490
Mime-Version: 1.0
Karsten Hopp 9c3490
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 9c3490
Content-Transfer-Encoding: 8bit
Karsten Hopp 9c3490
------------
Karsten Hopp 9c3490
Karsten Hopp 9c3490
Patch 7.1.241
Karsten Hopp 9c3490
Problem:    Focus change events not always ignored.  (Erik Falor)
Karsten Hopp 9c3490
Solution:   Ignore K_IGNORE in Insert mode in a few more places.
Karsten Hopp 9c3490
Files:	    src/edit.c
Karsten Hopp 9c3490
Karsten Hopp 9c3490
Karsten Hopp 9c3490
*** ../vim-7.1.240/src/edit.c	Wed Jan 16 20:01:14 2008
Karsten Hopp 9c3490
--- src/edit.c	Tue Jan 22 17:45:32 2008
Karsten Hopp 9c3490
***************
Karsten Hopp 9c3490
*** 703,712 ****
Karsten Hopp 9c3490
  #endif
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
  	/*
Karsten Hopp 9c3490
! 	 * Get a character for Insert mode.
Karsten Hopp 9c3490
  	 */
Karsten Hopp 9c3490
  	lastc = c;			/* remember previous char for CTRL-D */
Karsten Hopp 9c3490
! 	c = safe_vgetc();
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
  #ifdef FEAT_AUTOCMD
Karsten Hopp 9c3490
  	/* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
Karsten Hopp 9c3490
--- 703,715 ----
Karsten Hopp 9c3490
  #endif
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
  	/*
Karsten Hopp 9c3490
! 	 * Get a character for Insert mode.  Ignore K_IGNORE.
Karsten Hopp 9c3490
  	 */
Karsten Hopp 9c3490
  	lastc = c;			/* remember previous char for CTRL-D */
Karsten Hopp 9c3490
! 	do
Karsten Hopp 9c3490
! 	{
Karsten Hopp 9c3490
! 	    c = safe_vgetc();
Karsten Hopp 9c3490
! 	} while (c == K_IGNORE);
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
  #ifdef FEAT_AUTOCMD
Karsten Hopp 9c3490
  	/* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
Karsten Hopp 9c3490
***************
Karsten Hopp 9c3490
*** 777,783 ****
Karsten Hopp 9c3490
  	/* Prepare for or stop CTRL-X mode.  This doesn't do completion, but
Karsten Hopp 9c3490
  	 * it does fix up the text when finishing completion. */
Karsten Hopp 9c3490
  	compl_get_longest = FALSE;
Karsten Hopp 9c3490
! 	if (c != K_IGNORE && ins_compl_prep(c))
Karsten Hopp 9c3490
  	    continue;
Karsten Hopp 9c3490
  #endif
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
--- 780,786 ----
Karsten Hopp 9c3490
  	/* Prepare for or stop CTRL-X mode.  This doesn't do completion, but
Karsten Hopp 9c3490
  	 * it does fix up the text when finishing completion. */
Karsten Hopp 9c3490
  	compl_get_longest = FALSE;
Karsten Hopp 9c3490
! 	if (ins_compl_prep(c))
Karsten Hopp 9c3490
  	    continue;
Karsten Hopp 9c3490
  #endif
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
***************
Karsten Hopp 9c3490
*** 4516,4530 ****
Karsten Hopp 9c3490
  	else
Karsten Hopp 9c3490
  	{
Karsten Hopp 9c3490
  	    /* Need to get the character to have KeyTyped set.  We'll put it
Karsten Hopp 9c3490
! 	     * back with vungetc() below. */
Karsten Hopp 9c3490
  	    c = safe_vgetc();
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
! 	    /* Don't interrupt completion when the character wasn't typed,
Karsten Hopp 9c3490
! 	     * e.g., when doing @q to replay keys. */
Karsten Hopp 9c3490
! 	    if (c != Ctrl_R && KeyTyped)
Karsten Hopp 9c3490
! 		compl_interrupted = TRUE;
Karsten Hopp 9c3490
! 
Karsten Hopp 9c3490
! 	    vungetc(c);
Karsten Hopp 9c3490
  	}
Karsten Hopp 9c3490
      }
Karsten Hopp 9c3490
      if (compl_pending != 0 && !got_int)
Karsten Hopp 9c3490
--- 4519,4535 ----
Karsten Hopp 9c3490
  	else
Karsten Hopp 9c3490
  	{
Karsten Hopp 9c3490
  	    /* Need to get the character to have KeyTyped set.  We'll put it
Karsten Hopp 9c3490
! 	     * back with vungetc() below.  But skip K_IGNORE. */
Karsten Hopp 9c3490
  	    c = safe_vgetc();
Karsten Hopp 9c3490
+ 	    if (c != K_IGNORE)
Karsten Hopp 9c3490
+ 	    {
Karsten Hopp 9c3490
+ 		/* Don't interrupt completion when the character wasn't typed,
Karsten Hopp 9c3490
+ 		 * e.g., when doing @q to replay keys. */
Karsten Hopp 9c3490
+ 		if (c != Ctrl_R && KeyTyped)
Karsten Hopp 9c3490
+ 		    compl_interrupted = TRUE;
Karsten Hopp 9c3490
  
Karsten Hopp 9c3490
! 		vungetc(c);
Karsten Hopp 9c3490
! 	    }
Karsten Hopp 9c3490
  	}
Karsten Hopp 9c3490
      }
Karsten Hopp 9c3490
      if (compl_pending != 0 && !got_int)
Karsten Hopp 9c3490
*** ../vim-7.1.240/src/version.c	Tue Jan 22 16:01:25 2008
Karsten Hopp 9c3490
--- src/version.c	Tue Jan 22 17:48:46 2008
Karsten Hopp 9c3490
***************
Karsten Hopp 9c3490
*** 668,669 ****
Karsten Hopp 9c3490
--- 668,671 ----
Karsten Hopp 9c3490
  {   /* Add new patch number below this line */
Karsten Hopp 9c3490
+ /**/
Karsten Hopp 9c3490
+     241,
Karsten Hopp 9c3490
  /**/
Karsten Hopp 9c3490
Karsten Hopp 9c3490
-- 
Karsten Hopp 9c3490
The problem with political jokes is that they get elected.
Karsten Hopp 9c3490
Karsten Hopp 9c3490
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 9c3490
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 9c3490
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 9c3490
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///