mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 7.4.1757
Problem: When using complete() it may set 'modified' even though nothing was inserted. Solution: Use Down/Up instead of Next/Previous match. (Shougo, closes #745)
This commit is contained in:
12
src/edit.c
12
src/edit.c
@@ -2813,12 +2813,15 @@ set_completion(colnr_T startcol, list_T *list)
|
|||||||
compl_cont_status = 0;
|
compl_cont_status = 0;
|
||||||
|
|
||||||
compl_curr_match = compl_first_match;
|
compl_curr_match = compl_first_match;
|
||||||
if (compl_no_insert)
|
if (compl_no_insert || compl_no_select)
|
||||||
|
{
|
||||||
ins_complete(K_DOWN, FALSE);
|
ins_complete(K_DOWN, FALSE);
|
||||||
|
if (compl_no_select)
|
||||||
|
/* Down/Up has no real effect. */
|
||||||
|
ins_complete(K_UP, FALSE);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ins_complete(Ctrl_N, FALSE);
|
ins_complete(Ctrl_N, FALSE);
|
||||||
if (compl_no_select)
|
|
||||||
ins_complete(Ctrl_P, FALSE);
|
|
||||||
|
|
||||||
/* Lazily show the popup menu, unless we got interrupted. */
|
/* Lazily show the popup menu, unless we got interrupted. */
|
||||||
if (!compl_interrupted)
|
if (!compl_interrupted)
|
||||||
@@ -4969,8 +4972,7 @@ ins_compl_check_keys(int frequency)
|
|||||||
ins_compl_key2dir(int c)
|
ins_compl_key2dir(int c)
|
||||||
{
|
{
|
||||||
if (c == Ctrl_P || c == Ctrl_L
|
if (c == Ctrl_P || c == Ctrl_L
|
||||||
|| (pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP
|
|| c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP || c == K_UP)
|
||||||
|| c == K_S_UP || c == K_UP)))
|
|
||||||
return BACKWARD;
|
return BACKWARD;
|
||||||
return FORWARD;
|
return FORWARD;
|
||||||
}
|
}
|
||||||
|
@@ -748,6 +748,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 */
|
||||||
|
/**/
|
||||||
|
1757,
|
||||||
/**/
|
/**/
|
||||||
1756,
|
1756,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user