mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(event-loop): duplicate display updating logic in vgetorpeek() (#17913)
This commit is contained in:
@@ -1589,6 +1589,18 @@ describe('API', function()
|
||||
feed(':digraphs<cr>')
|
||||
eq({mode='rm', blocking=true}, nvim("get_mode"))
|
||||
end)
|
||||
|
||||
it('after <Nop> mapping returns blocking=false #17257', function()
|
||||
command('nnoremap <F2> <Nop>')
|
||||
feed('<F2>')
|
||||
eq({mode='n', blocking=false}, nvim("get_mode"))
|
||||
end)
|
||||
|
||||
it('after empty string <expr> mapping returns blocking=false #17257', function()
|
||||
command('nnoremap <expr> <F2> ""')
|
||||
feed('<F2>')
|
||||
eq({mode='n', blocking=false}, nvim("get_mode"))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('RPC (K_EVENT)', function()
|
||||
|
||||
@@ -320,3 +320,47 @@ describe("event processing and input", function()
|
||||
eq({'notification', 'stop', {}}, next_msg())
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('display is updated', function()
|
||||
local screen
|
||||
before_each(function()
|
||||
screen = Screen.new(60, 8)
|
||||
screen:set_default_attr_ids({
|
||||
[1] = {bold = true, foreground = Screen.colors.Blue1}, -- NonText
|
||||
[2] = {bold = true}, -- ModeMsg
|
||||
})
|
||||
screen:attach()
|
||||
end)
|
||||
|
||||
it('in Insert mode after <Nop> mapping #17911', function()
|
||||
command('imap <Plug>test <Nop>')
|
||||
command('imap <F2> abc<CR><Plug>test')
|
||||
feed('i<F2>')
|
||||
screen:expect([[
|
||||
abc |
|
||||
^ |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{2:-- INSERT --} |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('in Insert mode after empty string <expr> mapping #17911', function()
|
||||
command('imap <expr> <Plug>test ""')
|
||||
command('imap <F2> abc<CR><Plug>test')
|
||||
feed('i<F2>')
|
||||
screen:expect([[
|
||||
abc |
|
||||
^ |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{2:-- INSERT --} |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -273,7 +273,7 @@ describe('timers', function()
|
||||
eq("Vim(call):E48: Not allowed in sandbox", exc_exec("sandbox call timer_start(0, 'Scary')"))
|
||||
end)
|
||||
|
||||
it('can be triggered after an empty string <expr> mapping', function()
|
||||
it('can be triggered after an empty string <expr> mapping #17257', function()
|
||||
local screen = Screen.new(40, 6)
|
||||
screen:attach()
|
||||
command([=[imap <expr> <F2> [timer_start(0, { _ -> execute("throw 'x'", "") }), ''][-1]]=])
|
||||
|
||||
Reference in New Issue
Block a user