mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
Merge pull request #17102 from zeertzjq/vim-8.2.1762
vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
This commit is contained in:
@@ -663,8 +663,12 @@ static int insert_execute(VimState *state, int key)
|
|||||||
InsertState *const s = (InsertState *)state;
|
InsertState *const s = (InsertState *)state;
|
||||||
if (stop_insert_mode) {
|
if (stop_insert_mode) {
|
||||||
// Insert mode ended, possibly from a callback.
|
// Insert mode ended, possibly from a callback.
|
||||||
|
if (key != K_IGNORE && key != K_NOP) {
|
||||||
|
vungetc(key);
|
||||||
|
}
|
||||||
s->count = 0;
|
s->count = 0;
|
||||||
s->nomove = true;
|
s->nomove = true;
|
||||||
|
ins_compl_prep(ESC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -445,6 +445,28 @@ func Test_issue_7021()
|
|||||||
set completeslash=
|
set completeslash=
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_pum_stopped_by_timer()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
call setline(1, ['hello', 'hullo', 'heeee', ''])
|
||||||
|
func StartCompl()
|
||||||
|
call timer_start(100, { -> execute('stopinsert') })
|
||||||
|
call feedkeys("Gah\<C-N>")
|
||||||
|
endfunc
|
||||||
|
END
|
||||||
|
|
||||||
|
call writefile(lines, 'Xpumscript')
|
||||||
|
let buf = RunVimInTerminal('-S Xpumscript', #{rows: 12})
|
||||||
|
call term_sendkeys(buf, ":call StartCompl()\<CR>")
|
||||||
|
call TermWait(buf, 200)
|
||||||
|
call term_sendkeys(buf, "k")
|
||||||
|
call VerifyScreenDump(buf, 'Test_pum_stopped_by_timer', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('Xpumscript')
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_pum_with_folds_two_tabs()
|
func Test_pum_with_folds_two_tabs()
|
||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
|
@@ -2271,6 +2271,47 @@ describe('builtin popupmenu', function()
|
|||||||
assert_alive()
|
assert_alive()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('is closed by :stopinsert from timer #12976', function()
|
||||||
|
screen:try_resize(32,14)
|
||||||
|
command([[call setline(1, ['hello', 'hullo', 'heeee', ''])]])
|
||||||
|
feed('Gah<C-N>')
|
||||||
|
screen:expect([[
|
||||||
|
hello |
|
||||||
|
hullo |
|
||||||
|
heeee |
|
||||||
|
hello^ |
|
||||||
|
{s:hello }{1: }|
|
||||||
|
{n:hullo }{1: }|
|
||||||
|
{n:heeee }{1: }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{2:-- }{5:match 1 of 3} |
|
||||||
|
]])
|
||||||
|
command([[call timer_start(100, { -> execute('stopinsert') })]])
|
||||||
|
helpers.sleep(200)
|
||||||
|
feed('k') -- cursor should move up in Normal mode
|
||||||
|
screen:expect([[
|
||||||
|
hello |
|
||||||
|
hullo |
|
||||||
|
heee^e |
|
||||||
|
hello |
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
it('truncates double-width character correctly when there is no scrollbar', function()
|
it('truncates double-width character correctly when there is no scrollbar', function()
|
||||||
screen:try_resize(32,8)
|
screen:try_resize(32,8)
|
||||||
command('set completeopt+=menuone,noselect')
|
command('set completeopt+=menuone,noselect')
|
||||||
|
Reference in New Issue
Block a user