Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It looks like there is a code demo error in the cookbook? #140

Closed
MenMensAa opened this issue Apr 20, 2023 · 1 comment · Fixed by #157
Closed

It looks like there is a code demo error in the cookbook? #140

MenMensAa opened this issue Apr 20, 2023 · 1 comment · Fixed by #157

Comments

@MenMensAa
Copy link

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
Copy link
Owner

rebelot commented Apr 20, 2023

mhh can't reproduce but should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants