1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: complete() function doesn't reset complete direction. Can't use
12 an empty string in the list of matches.
13 Solution: Set compl_direction to FORWARD. Add "empty" key to allow empty
18 *** ../vim-7.3.052/src/edit.c 2010-11-10 16:54:16.000000000 +0100
19 --- src/edit.c 2010-11-10 17:03:23.000000000 +0100
23 if (stop_arrow() == FAIL)
26 + compl_direction = FORWARD;
27 if (startcol > curwin->w_cursor.col)
28 startcol = curwin->w_cursor.col;
37 char_u *(cptext[CPT_COUNT]);
39 if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
42 icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
43 if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
44 adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
48 word = get_tv_string_chk(tv);
49 vim_memset(cptext, 0, sizeof(cptext));
51 ! if (word == NULL || *word == NUL)
53 return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
56 icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
57 if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
58 adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
59 + if (get_dict_string(tv->vval.v_dict, (char_u *)"empty", FALSE) != NULL)
60 + aempty = get_dict_number(tv->vval.v_dict, (char_u *)"empty");
64 word = get_tv_string_chk(tv);
65 vim_memset(cptext, 0, sizeof(cptext));
67 ! if (word == NULL || (!aempty && *word == NUL))
69 return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
71 *** ../vim-7.3.052/src/version.c 2010-11-10 16:54:16.000000000 +0100
72 --- src/version.c 2010-11-10 17:10:39.000000000 +0100
76 { /* Add new patch number below this line */
82 BEDEVERE: How do you know so much about swallows?
83 ARTHUR: Well you have to know these things when you're a king, you know.
84 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
86 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
87 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
88 \\\ download, build and distribute -- http://www.A-A-P.org ///
89 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///