40f846d
To: vim_dev@googlegroups.com
40f846d
Subject: Patch 7.3.053
40f846d
Fcc: outbox
40f846d
From: Bram Moolenaar <Bram@moolenaar.net>
40f846d
Mime-Version: 1.0
40f846d
Content-Type: text/plain; charset=UTF-8
40f846d
Content-Transfer-Encoding: 8bit
40f846d
------------
40f846d
40f846d
Patch 7.3.053
40f846d
Problem:    complete() function doesn't reset complete direction.  Can't use
40f846d
	    an empty string in the list of matches.
40f846d
Solution:   Set compl_direction to FORWARD.  Add "empty" key to allow empty
40f846d
	    words. (Kikuchan)
40f846d
Files:	    src/edit.c
40f846d
40f846d
40f846d
*** ../vim-7.3.052/src/edit.c	2010-11-10 16:54:16.000000000 +0100
40f846d
--- src/edit.c	2010-11-10 17:03:23.000000000 +0100
40f846d
***************
40f846d
*** 2662,2667 ****
40f846d
--- 2662,2668 ----
40f846d
      if (stop_arrow() == FAIL)
40f846d
  	return;
40f846d
  
40f846d
+     compl_direction = FORWARD;
40f846d
      if (startcol > curwin->w_cursor.col)
40f846d
  	startcol = curwin->w_cursor.col;
40f846d
      compl_col = startcol;
40f846d
***************
40f846d
*** 3909,3914 ****
40f846d
--- 3910,3916 ----
40f846d
      char_u	*word;
40f846d
      int		icase = FALSE;
40f846d
      int		adup = FALSE;
40f846d
+     int		aempty = FALSE;
40f846d
      char_u	*(cptext[CPT_COUNT]);
40f846d
  
40f846d
      if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
40f846d
***************
40f846d
*** 3926,3938 ****
40f846d
  	    icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
40f846d
  	if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
40f846d
  	    adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
40f846d
      }
40f846d
      else
40f846d
      {
40f846d
  	word = get_tv_string_chk(tv);
40f846d
  	vim_memset(cptext, 0, sizeof(cptext));
40f846d
      }
40f846d
!     if (word == NULL || *word == NUL)
40f846d
  	return FAIL;
40f846d
      return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
40f846d
  }
40f846d
--- 3928,3942 ----
40f846d
  	    icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
40f846d
  	if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
40f846d
  	    adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
40f846d
+ 	if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
40f846d
+ 	    aempty = get_dict_number(tv->vval.v_dict, (char_u *)"empty");
40f846d
      }
40f846d
      else
40f846d
      {
40f846d
  	word = get_tv_string_chk(tv);
40f846d
  	vim_memset(cptext, 0, sizeof(cptext));
40f846d
      }
40f846d
!     if (word == NULL || (!aempty && *word == NUL))
40f846d
  	return FAIL;
40f846d
      return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
40f846d
  }
40f846d
*** ../vim-7.3.052/src/version.c	2010-11-10 16:54:16.000000000 +0100
40f846d
--- src/version.c	2010-11-10 17:10:39.000000000 +0100
40f846d
***************
40f846d
*** 716,717 ****
40f846d
--- 716,719 ----
40f846d
  {   /* Add new patch number below this line */
40f846d
+ /**/
40f846d
+     53,
40f846d
  /**/
40f846d
40f846d
-- 
40f846d
BEDEVERE: How do you know so much about swallows?
40f846d
ARTHUR:   Well you have to know these things when you're a king, you know.
40f846d
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
40f846d
40f846d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
40f846d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
40f846d
\\\        download, build and distribute -- http://www.A-A-P.org        ///
40f846d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///