mirror of
https://github.com/neovim/neovim.git
synced 2025-11-26 20:20:42 +00:00
Merge pull request #17279 from zeertzjq/state-enter-vpeekc
fix(event-loop): call vpeekc() directly first to check for character
This commit is contained in:
@@ -140,6 +140,25 @@ describe('input utf sequences that contain CSI (0x9B)', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('input split utf sequences', function()
|
||||
it('ok', function()
|
||||
local str = '►'
|
||||
feed('i' .. str:sub(1, 1))
|
||||
helpers.sleep(10)
|
||||
feed(str:sub(2, 3))
|
||||
expect('►')
|
||||
end)
|
||||
|
||||
it('can be mapped', function()
|
||||
command('inoremap ► E296BA')
|
||||
local str = '►'
|
||||
feed('i' .. str:sub(1, 1))
|
||||
helpers.sleep(10)
|
||||
feed(str:sub(2, 3))
|
||||
expect('E296BA')
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('input non-printable chars', function()
|
||||
after_each(function()
|
||||
os.remove('Xtest-overwrite')
|
||||
|
||||
@@ -272,4 +272,12 @@ 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()
|
||||
local screen = Screen.new(40, 6)
|
||||
screen:attach()
|
||||
command([=[imap <expr> <F2> [timer_start(0, { _ -> execute("throw 'x'", "") }), ''][-1]]=])
|
||||
feed('i<F2>')
|
||||
screen:expect({any='E605: Exception not caught: x'})
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user