Merge pull request #4622 from Shougo/vim-7.4.1753

vim-patch:7.4.1753
This commit is contained in:
Justin M. Keyes 2016-04-27 21:01:03 -04:00
commit 2d5520fb25
3 changed files with 21 additions and 12 deletions

View File

@ -2319,6 +2319,22 @@ static int ins_compl_make_cyclic(void)
return count; return count;
} }
// Set variables that store noselect and noinsert behavior from the
// 'completeopt' value.
void completeopt_was_set(void)
{
compl_no_insert = false;
compl_no_select = false;
if (strstr((char *)p_cot, "noselect") != NULL) {
compl_no_select = true;
}
if (strstr((char *)p_cot, "noinsert") != NULL) {
compl_no_insert = true;
}
}
/* /*
* Start completion for the complete() function. * Start completion for the complete() function.
* "startcol" is where the matched text starts (1 is first column). * "startcol" is where the matched text starts (1 is first column).
@ -3097,17 +3113,6 @@ static bool ins_compl_prep(int c)
} }
if (strstr((char *)p_cot, "noselect") != NULL) {
compl_no_insert = FALSE;
compl_no_select = TRUE;
} else if (strstr((char *)p_cot, "noinsert") != NULL) {
compl_no_insert = TRUE;
compl_no_select = FALSE;
} else {
compl_no_insert = FALSE;
compl_no_select = FALSE;
}
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET) { if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET) {
/* /*
* We have just typed CTRL-X and aren't quite sure which CTRL-X mode * We have just typed CTRL-X and aren't quite sure which CTRL-X mode

View File

@ -2958,8 +2958,11 @@ did_set_string_option (
} }
/* 'completeopt' */ /* 'completeopt' */
else if (varp == &p_cot) { else if (varp == &p_cot) {
if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK) if (check_opt_strings(p_cot, p_cot_values, true) != OK) {
errmsg = e_invarg; errmsg = e_invarg;
} else {
completeopt_was_set();
}
} }
/* 'pastetoggle': translate key codes like in a mapping */ /* 'pastetoggle': translate key codes like in a mapping */
else if (varp == &p_pt) { else if (varp == &p_pt) {

View File

@ -71,6 +71,7 @@ static char *features[] = {
static int included_patches[] = { static int included_patches[] = {
1757, 1757,
1755, 1755,
1753,
1654, 1654,
1652, 1652,
1643, 1643,