It looks like there is a code demo error in the cookbook?
Closed this issue · 1 comments
MenMensAa commented
I found that clicking the close button in bufferlines does not update the UI.
local TablineCloseButton = {
condition = function(self)
return not vim.api.nvim_buf_get_option(self.bufnr, "modified")
end,
{ provider = " " },
{
provider = "",
hl = { fg = "gray" },
on_click = {
callback = function(_, minwid)
vim.schedule(function()
vim.api.nvim_buf_delete(minwid, { force = false })
vim.cmd.redrawtabline() -- It works,UI was updated as expected
end)
-- vim.cmd.redrawtabline() -- Here! This line of code should be wrapped in the previous function.
end,
minwid = function(self)
return self.bufnr
end,
name = "heirline_tabline_close_buffer_callback",
},
},
}
rebelot commented
mhh can't reproduce but should be fixed