fix(ui): ignore textlock for vim.ui_attach() callbacks #36278

Problem:  vim.ui_attach() callbacks may run into E565 textlock errors.
Solution: Changing text in UI buffers must be safe; assume it is.
This commit is contained in:
luukvbaal
2025-10-24 23:40:21 +02:00
committed by GitHub
parent 470585b5d0
commit d909de2dc2
2 changed files with 23 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
-- Tests for (protocol-driven) ui2, intended to replace the legacy message grid UI.
local t = require('test.testutil')
local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
@@ -106,4 +107,21 @@ describe('cmdline2', function()
{16::}{15:call} {25:foo}{16:()}^ |
]])
end)
it('can change cmdline buffer during textlock', function()
exec([[
func Foo(a, b)
redrawstatus!
endfunc
set wildoptions=pum findfunc=Foo wildmode=noselect:lastused,full
au CmdlineChanged * call wildtrigger()
]])
feed(':find ')
screen:expect([[
|
{1:~ }|*12
{16::}{15:find} ^ |
]])
t.eq(n.eval('v:errmsg'), "E1514: 'findfunc' did not return a List type")
end)
end)