summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.3.053
blob: 687b39d2bf41e690e95ef17107021814e46cdfd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
To: vim_dev@googlegroups.com
Subject: Patch 7.3.053
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.053
Problem:    complete() function doesn't reset complete direction.  Can't use
	    an empty string in the list of matches.
Solution:   Set compl_direction to FORWARD.  Add "empty" key to allow empty
	    words. (Kikuchan)
Files:	    src/edit.c


*** ../vim-7.3.052/src/edit.c	2010-11-10 16:54:16.000000000 +0100
--- src/edit.c	2010-11-10 17:03:23.000000000 +0100
***************
*** 2662,2667 ****
--- 2662,2668 ----
      if (stop_arrow() == FAIL)
  	return;
  
+     compl_direction = FORWARD;
      if (startcol > curwin->w_cursor.col)
  	startcol = curwin->w_cursor.col;
      compl_col = startcol;
***************
*** 3909,3914 ****
--- 3910,3916 ----
      char_u	*word;
      int		icase = FALSE;
      int		adup = FALSE;
+     int		aempty = FALSE;
      char_u	*(cptext[CPT_COUNT]);
  
      if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
***************
*** 3926,3938 ****
  	    icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
  	if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
  	    adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
      }
      else
      {
  	word = get_tv_string_chk(tv);
  	vim_memset(cptext, 0, sizeof(cptext));
      }
!     if (word == NULL || *word == NUL)
  	return FAIL;
      return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
  }
--- 3928,3942 ----
  	    icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
  	if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
  	    adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
+ 	if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
+ 	    aempty = get_dict_number(tv->vval.v_dict, (char_u *)"empty");
      }
      else
      {
  	word = get_tv_string_chk(tv);
  	vim_memset(cptext, 0, sizeof(cptext));
      }
!     if (word == NULL || (!aempty && *word == NUL))
  	return FAIL;
      return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
  }
*** ../vim-7.3.052/src/version.c	2010-11-10 16:54:16.000000000 +0100
--- src/version.c	2010-11-10 17:10:39.000000000 +0100
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     53,
  /**/

-- 
BEDEVERE: How do you know so much about swallows?
ARTHUR:   Well you have to know these things when you're a king, you know.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@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    ///