Skip to content

Is there a way to hide/disable the plugin on the fly. #204

Answered by Bekaboo
bassamsdata asked this question in Q&A
Discussion options

You must be logged in to vote

You can try to customize your bar.enable function so that it won't attach to current window if window-local variable winbar_no_attach is set, like this:

require('dropbar').setup({
  bar = {
    enable = function(buf, win, _)
      return not vim.w[win].winbar_no_attach -- add this line
        and vim.api.nvim_buf_is_valid(buf)
        and vim.api.nvim_win_is_valid(win)
        and vim.wo[win].winbar == ''
        and vim.fn.win_gettype(win) == ''
        and vim.bo[buf].ft ~= 'help'
        and ((pcall(vim.treesitter.get_parser, buf)) and true or false)
    end,
  },
})

Then to disable dropbar in current window, you can just use the command :setlocal winbar= | let w:winbar_no_attach = v:…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bassamsdata
Comment options

Answer selected by bassamsdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants