bt_ignore doesn't work, also potential better default
meijieru opened this issue · comments
Thank you for providing the helpful plugin.
I have encountered an issue with the bt_ignore option when using the following settings. Despite specifying bt_ignore, the set stc
command still reports statuscolumn=%!v:lua.StatusCol()
.
Furthermore, would it be more appropriate to have the status column disabled by default for nofile and prompt buftypes?
function M.statuscol()
local builtin = require "statuscol.builtin"
require("statuscol").setup {
setopt = true,
bt_ignore = { "nofile", "prompt" },
segments = {
{
sign = { name = { "GitSigns" }, maxwidth = 1, colwidth = 1, auto = false },
click = "v:lua.ScSa",
},
{
text = { builtin.lnumfunc, " " },
condition = { true, builtin.not_empty },
click = "v:lua.ScLa",
},
{
sign = { name = { ".*" }, maxwidth = 1, colwidth = 1, auto = false },
click = "v:lua.ScSa",
},
{ text = { builtin.foldfunc, " " }, click = "v:lua.ScFa" },
},
}
end
Could you provide reproduction steps for a case where you encountered 'statuscolumn'
not being unset in a "nofile/prompt"
buffer? There were similar problems with ft_ignore
, for which we added a "BufEnter"
autocmd besides FileType
. Might need something similar here but would like to see the issue first.
I don't think we want to set a default for ft/bt_ignore
. Users might find a use for 'statuscolumn'
in any arbitrary buffer.
I am currently using aerial.nvim and opening the window using AerialToggle
. I observed that it sets the buftype
here.
Similarly, I have encountered a similar issue with nvim-dap-ui.
Please try out the latest commit, it works in my testing.
Fixed. Thx!
Problem fixed for aerial & dap-ui. Still have a problem with overseer.nvim when OverseerToggle
.
The problem is that overseer disables autocmds for their window creation. I don't think there's anything we can do about that here.
FWIW, adding Overseer*
to ft_ignore
does work, because they set it later. Perhaps you can propose that they set 'buftype'
later as well.
Thx!