]>
Commit | Line | Data |
---|---|---|
c9934a4a ER |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.053 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.053 | |
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 | |
14 | words. (Kikuchan) | |
15 | Files: src/edit.c | |
16 | ||
17 | ||
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 | |
20 | *************** | |
21 | *** 2662,2667 **** | |
22 | --- 2662,2668 ---- | |
23 | if (stop_arrow() == FAIL) | |
24 | return; | |
25 | ||
26 | + compl_direction = FORWARD; | |
27 | if (startcol > curwin->w_cursor.col) | |
28 | startcol = curwin->w_cursor.col; | |
29 | compl_col = startcol; | |
30 | *************** | |
31 | *** 3909,3914 **** | |
32 | --- 3910,3916 ---- | |
33 | char_u *word; | |
34 | int icase = FALSE; | |
35 | int adup = FALSE; | |
36 | + int aempty = FALSE; | |
37 | char_u *(cptext[CPT_COUNT]); | |
38 | ||
39 | if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) | |
40 | *************** | |
41 | *** 3926,3938 **** | |
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"); | |
45 | } | |
46 | else | |
47 | { | |
48 | word = get_tv_string_chk(tv); | |
49 | vim_memset(cptext, 0, sizeof(cptext)); | |
50 | } | |
51 | ! if (word == NULL || *word == NUL) | |
52 | return FAIL; | |
53 | return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup); | |
54 | } | |
55 | --- 3928,3942 ---- | |
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"); | |
61 | } | |
62 | else | |
63 | { | |
64 | word = get_tv_string_chk(tv); | |
65 | vim_memset(cptext, 0, sizeof(cptext)); | |
66 | } | |
67 | ! if (word == NULL || (!aempty && *word == NUL)) | |
68 | return FAIL; | |
69 | return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup); | |
70 | } | |
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 | |
73 | *************** | |
74 | *** 716,717 **** | |
75 | --- 716,719 ---- | |
76 | { /* Add new patch number below this line */ | |
77 | + /**/ | |
78 | + 53, | |
79 | /**/ | |
80 | ||
81 | -- | |
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 | |
85 | ||
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 /// |