mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 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)
This commit is contained in:
parent
37dd018cdd
commit
2a8caa414e
@ -2662,6 +2662,7 @@ set_completion(startcol, list)
|
|||||||
if (stop_arrow() == FAIL)
|
if (stop_arrow() == FAIL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
compl_direction = FORWARD;
|
||||||
if (startcol > curwin->w_cursor.col)
|
if (startcol > curwin->w_cursor.col)
|
||||||
startcol = curwin->w_cursor.col;
|
startcol = curwin->w_cursor.col;
|
||||||
compl_col = startcol;
|
compl_col = startcol;
|
||||||
@ -3909,6 +3910,7 @@ ins_compl_add_tv(tv, dir)
|
|||||||
char_u *word;
|
char_u *word;
|
||||||
int icase = FALSE;
|
int icase = FALSE;
|
||||||
int adup = FALSE;
|
int adup = FALSE;
|
||||||
|
int aempty = FALSE;
|
||||||
char_u *(cptext[CPT_COUNT]);
|
char_u *(cptext[CPT_COUNT]);
|
||||||
|
|
||||||
if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
|
if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
|
||||||
@ -3926,13 +3928,15 @@ ins_compl_add_tv(tv, dir)
|
|||||||
icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
|
icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
|
||||||
if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
|
if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
|
||||||
adup = get_dict_number(tv->vval.v_dict, (char_u *)"dup");
|
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
|
else
|
||||||
{
|
{
|
||||||
word = get_tv_string_chk(tv);
|
word = get_tv_string_chk(tv);
|
||||||
vim_memset(cptext, 0, sizeof(cptext));
|
vim_memset(cptext, 0, sizeof(cptext));
|
||||||
}
|
}
|
||||||
if (word == NULL || *word == NUL)
|
if (word == NULL || (!aempty && *word == NUL))
|
||||||
return FAIL;
|
return FAIL;
|
||||||
return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
|
return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
|
||||||
}
|
}
|
||||||
|
@ -714,6 +714,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
53,
|
||||||
/**/
|
/**/
|
||||||
52,
|
52,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user