mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
complete: noinsert/noselect should not set 'modified'. #4509
This commit is contained in:
parent
5330aa104b
commit
d227c843bf
@ -2358,13 +2358,13 @@ void set_completion(colnr_T startcol, list_T *list)
|
||||
int save_w_wrow = curwin->w_wrow;
|
||||
|
||||
compl_curr_match = compl_first_match;
|
||||
if (compl_no_insert) {
|
||||
if (compl_no_insert || compl_no_select) {
|
||||
ins_complete(K_DOWN, false);
|
||||
if (compl_no_select) {
|
||||
ins_complete(K_UP, false);
|
||||
}
|
||||
} else {
|
||||
ins_complete(Ctrl_N, false);
|
||||
if (compl_no_select) {
|
||||
ins_complete(Ctrl_P, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Lazily show the popup menu, unless we got interrupted.
|
||||
@ -4239,9 +4239,10 @@ void ins_compl_check_keys(int frequency)
|
||||
static int ins_compl_key2dir(int c)
|
||||
{
|
||||
if (c == Ctrl_P || c == Ctrl_L
|
||||
|| (pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP
|
||||
|| c == K_S_UP || c == K_UP)))
|
||||
|| c == K_PAGEUP || c == K_KPAGEUP
|
||||
|| c == K_S_UP || c == K_UP) {
|
||||
return BACKWARD;
|
||||
}
|
||||
return FORWARD;
|
||||
}
|
||||
|
||||
|
@ -100,6 +100,18 @@ describe('completion', function()
|
||||
feed('o<C-r>=TestComplete()<CR><ESC>')
|
||||
eq('', eval('getline(3)'))
|
||||
end)
|
||||
it('does not change modified state if noinsert', function()
|
||||
execute('set completeopt+=menuone,noinsert')
|
||||
execute('setlocal nomodified')
|
||||
feed('i<C-r>=TestComplete()<CR><ESC>')
|
||||
eq(0, eval('&l:modified'))
|
||||
end)
|
||||
it('does not change modified state if noselect', function()
|
||||
execute('set completeopt+=menuone,noselect')
|
||||
execute('setlocal nomodified')
|
||||
feed('i<C-r>=TestComplete()<CR><ESC>')
|
||||
eq(0, eval('&l:modified'))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe("refresh:always", function()
|
||||
|
Loading…
Reference in New Issue
Block a user