Skip to content

Commit 082d3ab

Browse files
committed
bugfix
1 parent ae0ed55 commit 082d3ab

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lua/easycomplete/cmdline.lua

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local console = util.console
44
local cmdline_start_cmdpos = 0
55
local old_cmdline = ""
66
local pum_noselect = vim.g.easycomplete_pum_noselect
7+
local redraw_queued = false
78
local this = {}
89

910
function this.pum_complete(start_col, menu_items)
@@ -14,10 +15,15 @@ end
1415
function this.pum_redraw()
1516
if vim.fn.has('nvim-0.10') then
1617
local pum_bufid = this.pum_bufid()
17-
vim.api.nvim__redraw({
18-
buf = pum_bufid,
19-
flush = true
20-
})
18+
if redraw_queued then return end
19+
redraw_queued = true
20+
vim.schedule(function()
21+
redraw_queued = false
22+
vim.api.nvim__redraw({
23+
buf = pum_bufid,
24+
flush = true
25+
})
26+
end)
2127
else
2228
vim.cmd("redraw")
2329
end

0 commit comments

Comments
 (0)