910cb6a
To: vim-dev@vim.org
910cb6a
Subject: Patch 7.0.055
910cb6a
Fcc: outbox
910cb6a
From: Bram Moolenaar <Bram@moolenaar.net>
910cb6a
Mime-Version: 1.0
910cb6a
Content-Type: text/plain; charset=ISO-8859-1
910cb6a
Content-Transfer-Encoding: 8bit
910cb6a
------------
910cb6a
910cb6a
Patch 7.0.055
910cb6a
Problem:    ":startinsert" in a CmdwinEnter autocommand doesn't take immediate
910cb6a
	    effect. (Bradley White)
910cb6a
Solution:   Put a NOP key in the typeahead buffer.  Also avoid that using
910cb6a
	    CTRL-C to go back to the command line moves the cursor left.
910cb6a
Files:	    src/edit.c, src/ex_getln.c
910cb6a
910cb6a
910cb6a
*** ../vim-7.0.054/src/edit.c	Fri Jun 23 21:36:49 2006
910cb6a
--- src/edit.c	Wed Aug 16 16:17:29 2006
910cb6a
***************
910cb6a
*** 882,887 ****
910cb6a
--- 882,888 ----
910cb6a
  		/* Close the cmdline window. */
910cb6a
  		cmdwin_result = K_IGNORE;
910cb6a
  		got_int = FALSE; /* don't stop executing autocommands et al. */
910cb6a
+ 		nomove = TRUE;
910cb6a
  		goto doESCkey;
910cb6a
  	    }
910cb6a
  #endif
910cb6a
***************
910cb6a
*** 2414,2419 ****
910cb6a
--- 2415,2421 ----
910cb6a
      compl_matches = ins_compl_make_cyclic();
910cb6a
      compl_started = TRUE;
910cb6a
      compl_used_match = TRUE;
910cb6a
+     compl_cont_status = 0;
910cb6a
  
910cb6a
      compl_curr_match = compl_first_match;
910cb6a
      ins_complete(Ctrl_N);
910cb6a
*** ../vim-7.0.054/src/ex_getln.c	Sun Apr 30 20:43:17 2006
910cb6a
--- src/ex_getln.c	Wed Aug 16 16:07:04 2006
910cb6a
***************
910cb6a
*** 5982,5987 ****
910cb6a
--- 5982,5989 ----
910cb6a
      typestr[0] = cmdwin_type;
910cb6a
      typestr[1] = NUL;
910cb6a
      apply_autocmds(EVENT_CMDWINENTER, typestr, typestr, FALSE, curbuf);
910cb6a
+     if (restart_edit != 0)	/* autocmd with ":startinsert" */
910cb6a
+ 	stuffcharReadbuff(K_NOP);
910cb6a
  # endif
910cb6a
  
910cb6a
      i = RedrawingDisabled;
910cb6a
*** ../vim-7.0.054/src/version.c	Wed Aug 16 15:56:58 2006
910cb6a
--- src/version.c	Wed Aug 16 16:21:45 2006
910cb6a
***************
910cb6a
*** 668,669 ****
910cb6a
--- 668,671 ----
910cb6a
  {   /* Add new patch number below this line */
910cb6a
+ /**/
910cb6a
+     55,
910cb6a
  /**/
910cb6a
910cb6a
-- 
910cb6a
hundred-and-one symptoms of being an internet addict:
910cb6a
157. You fum through a magazine, you first check to see if it has a web
910cb6a
     address.
910cb6a
910cb6a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
910cb6a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
910cb6a
\\\        download, build and distribute -- http://www.A-A-P.org        ///
910cb6a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///