This commit is contained in:
hrsh7th
2022-01-07 00:38:42 +09:00
parent 1b94aacada
commit 796f925915
4 changed files with 29 additions and 4 deletions

View File

@@ -180,4 +180,27 @@ misc.deprecated = function(fn, msg)
end
end
--Redraw
misc.redraw = setmetatable({
doing = false,
force = false,
}, {
__call = function(self, force)
if self.doing then
return
end
self.doing = true
self.force = not not force
vim.schedule(function()
if self.force then
vim.cmd([[redraw!]])
else
vim.cmd([[redraw]])
end
self.doing = false
self.force = false
end)
end
})
return misc