Skip to content

Commit 2b57d8c

Browse files
akinshosstallion
authored andcommitted
fix(ui): always schedule refreshing
1 parent 1384ad6 commit 2b57d8c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lua/bufferline/ui.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ local components = {
4747
---@param item bufferline.Component?
4848
local function set_hover_state(item)
4949
state.set({ hovered = item })
50-
vim.schedule(M.refresh)
50+
M.refresh()
5151
end
5252

5353
---@class HoverOpts
@@ -127,8 +127,10 @@ end
127127
local function get_marker_size(count, element_size) return count > 0 and strwidth(tostring(count)) + element_size or 0 end
128128

129129
function M.refresh()
130-
vim.cmd("redrawtabline")
131-
vim.cmd("redraw")
130+
vim.schedule(function()
131+
vim.cmd("redrawtabline")
132+
vim.cmd("redraw")
133+
end)
132134
end
133135

134136
---Add click action to a component

0 commit comments

Comments
 (0)