mirror of
https://github.com/neovim/neovim.git
synced 2026-05-03 04:25:03 +00:00
test/ui: add redraw debug util
This commit is contained in:
committed by
Thiago de Arruda
parent
a5561fe610
commit
e5c4c4bca2
@@ -456,6 +456,24 @@ end
|
||||
function Screen:snapshot_util(attrs, ignore)
|
||||
-- util to generate screen test
|
||||
pcall(function() self:wait(function() return "error" end, 250) end)
|
||||
self:print_snapshot(attrs, ignore)
|
||||
end
|
||||
|
||||
function Screen:redraw_debug(attrs, ignore)
|
||||
self:print_snapshot(attrs, ignore)
|
||||
local function notification_cb(method, args)
|
||||
assert(method == 'redraw')
|
||||
for _, update in ipairs(args) do
|
||||
print(require('inspect')(update))
|
||||
end
|
||||
self:_redraw(args)
|
||||
self:print_snapshot(attrs, ignore)
|
||||
return true
|
||||
end
|
||||
run(nil, notification_cb, nil, 250)
|
||||
end
|
||||
|
||||
function Screen:print_snapshot(attrs, ignore)
|
||||
if ignore == nil then
|
||||
ignore = self._default_attr_ignore
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user