devel/vim 7.1.145,NONE,1.1

Karsten Hopp (karsten) fedora-extras-commits at redhat.com
Thu Nov 22 10:50:44 UTC 2007


Author: karsten

Update of /cvs/extras/devel/vim
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31346

Added Files:
	7.1.145 
Log Message:
patchlevel 145


--- NEW FILE 7.1.145 ---
To: vim-dev at vim.org
Subject: Patch 7.1.145
Fcc: outbox
From: Bram Moolenaar <Bram at moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.1.145
Problem:    Insert mode completion: When using the popup menu, after
	    completing a word and typing a non-word character Vim is still
	    completing the same word, following CTRL-N doesn't work.
	    Insert mode Completion: When using CTRL-X O and there is only
	    "struct." before the cursor, typing one char to reduce the
	    matches, then BS completion stops.
Solution:   When typing a character that is not part of the item being
	    completed, stop complete mode.  For whole line completion also
	    accept a space.  For file name completion stop at a path
	    separator.
	    For omni completion stay in completion mode even if completing
	    with empty string.
Files:	    src/edit.c


*** ../vim-7.1.144/src/edit.c	Thu Sep 13 18:25:08 2007
--- src/edit.c	Fri Oct 19 16:04:38 2007
***************
*** 129,134 ****
--- 129,135 ----
  
  static void ins_ctrl_x __ARGS((void));
  static int  has_compl_option __ARGS((int dict_opt));
+ static int  ins_compl_accept_char __ARGS((int c));
  static int ins_compl_add __ARGS((char_u *str, int len, int icase, char_u *fname, char_u **cptext, int cdir, int flags, int adup));
  static int  ins_compl_equal __ARGS((compl_T *match, char_u *str, int len));
  static void ins_compl_longest_match __ARGS((compl_T *match));
***************
*** 754,761 ****
  		    continue;
  		}
  
! 		/* A printable, non-white character: Add to "compl_leader". */
! 		if (vim_isprintc(c) && !vim_iswhite(c))
  		{
  		    ins_compl_addleader(c);
  		    continue;
--- 755,763 ----
  		    continue;
  		}
  
! 		/* A non-white character that fits in with the current
! 		 * completion: Add to "compl_leader". */
! 		if (ins_compl_accept_char(c))
  		{
  		    ins_compl_addleader(c);
  		    continue;
***************
*** 2053,2058 ****
--- 2055,2094 ----
  }
  
  /*
+  * Return TRUE when character "c" is part of the item currently being
+  * completed.  Used to decide whether to abandon complete mode when the menu
+  * is visible.
+  */
+     static int
+ ins_compl_accept_char(c)
+     int c;
+ {
+     if (ctrl_x_mode & CTRL_X_WANT_IDENT)
+ 	/* When expanding an identifier only accept identifier chars. */
+ 	return vim_isIDc(c);
+ 
+     switch (ctrl_x_mode)
+     {
+ 	case CTRL_X_FILES:
+ 	    /* When expanding file name only accept file name chars. But not
+ 	     * path separators, so that "proto/<Tab>" expands files in
+ 	     * "proto", not "proto/" as a whole */
+ 	    return vim_isfilec(c) && !vim_ispathsep(c);
+ 
+ 	case CTRL_X_CMDLINE:
+ 	case CTRL_X_OMNI:
+ 	    /* Command line and Omni completion can work with just about any
+ 	     * printable character, but do stop at white space. */
+ 	    return vim_isprintc(c) && !vim_iswhite(c);
+ 
+ 	case CTRL_X_WHOLE_LINE:
+ 	    /* For while line completion a space can be part of the line. */
+ 	    return vim_isprintc(c);
+     }
+     return vim_iswordc(c);
+ }
+ 
+ /*
   * This is like ins_compl_add(), but if 'ic' and 'inf' are set, then the
   * case of the originally typed text is used, and the case of the completed
   * text is inferred, ie this tries to work out what case you probably wanted
***************
*** 3128,3135 ****
      p = line + curwin->w_cursor.col;
      mb_ptr_back(line, p);
  
!     /* Stop completion when the whole word was deleted. */
!     if ((int)(p - line) - (int)compl_col <= 0)
  	return K_BS;
  
      /* Deleted more than what was used to find matches or didn't finish
--- 3164,3174 ----
      p = line + curwin->w_cursor.col;
      mb_ptr_back(line, p);
  
!     /* Stop completion when the whole word was deleted.  For Omni completion
!      * allow the word to be deleted, we won't match everything. */
!     if ((int)(p - line) - (int)compl_col < 0
! 	    || ((int)(p - line) - (int)compl_col == 0
! 		&& (ctrl_x_mode & CTRL_X_OMNI) == 0))
  	return K_BS;
  
      /* Deleted more than what was used to find matches or didn't finish
***************
*** 4591,4604 ****
  	curs_col = curwin->w_cursor.col;
  	compl_pending = 0;
  
! 	/* if this same ctrl_x_mode has been interrupted use the text from
  	 * "compl_startpos" to the cursor as a pattern to add a new word
  	 * instead of expand the one before the cursor, in word-wise if
! 	 * "compl_startpos"
! 	 * is not in the same line as the cursor then fix it (the line has
! 	 * been split because it was longer than 'tw').  if SOL is set then
! 	 * skip the previous pattern, a word at the beginning of the line has
! 	 * been inserted, we'll look for that  -- Acevedo. */
  	if ((compl_cont_status & CONT_INTRPT) == CONT_INTRPT
  					    && compl_cont_mode == ctrl_x_mode)
  	{
--- 4630,4642 ----
  	curs_col = curwin->w_cursor.col;
  	compl_pending = 0;
  
! 	/* If this same ctrl_x_mode has been interrupted use the text from
  	 * "compl_startpos" to the cursor as a pattern to add a new word
  	 * instead of expand the one before the cursor, in word-wise if
! 	 * "compl_startpos" is not in the same line as the cursor then fix it
! 	 * (the line has been split because it was longer than 'tw').  if SOL
! 	 * is set then skip the previous pattern, a word at the beginning of
! 	 * the line has been inserted, we'll look for that  -- Acevedo. */
  	if ((compl_cont_status & CONT_INTRPT) == CONT_INTRPT
  					    && compl_cont_mode == ctrl_x_mode)
  	{
*** ../vim-7.1.144/src/version.c	Fri Oct 19 18:57:33 2007
--- src/version.c	Fri Oct 19 20:38:21 2007
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     145,
  /**/

-- 
Micro$oft: where do you want to go today?
    Linux: where do you want to go tomorrow?
  FreeBSD: are you guys coming, or what?

 /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///




More information about the fedora-extras-commits mailing list