vscode.nvim
vscode.nvim copied to clipboard
Bufferline diagnostics breaking colours
It seems like when diagnostics get added to a buffer title, the highlights get messed up (see first 2 buffers above). Other than that they're usually fine when there's 0 diagnostics.
I'm using the options provided in the README for bufferline, on top of the existing options that LazyVim provides here: https://github.com/LazyVim/LazyVim/blob/a50f92f7550fb6e9f21c0852e6cb190e6fcd50f5/lua/lazyvim/plugins/ui.lua#L73-L95
My added config is kinda ugly cuz of the function and if statement but provided here just in case it's relevant
{
"akinsho/bufferline.nvim",
opts = function(_, opts)
-- only set this configs for vscode theme
if vim.g.colors_name == "vscode" then
opts.options = opts.options or {}
opts.highlights = opts.highlights or {}
table.insert(opts.options, {
indicator = {
style = "icon",
icon = " ",
},
left_trunc_marker = "",
modified_icon = "●",
offsets = { { filetype = "NvimTree", text = "EXPLORER", text_align = "center" } },
right_trunc_marker = "",
show_close_icon = false,
show_tab_indicators = true,
})
opts.highlights = {
fill = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLineNC" },
},
background = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLine" },
},
buffer_visible = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
buffer_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
separator = {
fg = { attribute = "bg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLine" },
},
separator_selected = {
fg = { attribute = "fg", highlight = "Special" },
bg = { attribute = "bg", highlight = "Normal" },
},
separator_visible = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLineNC" },
},
close_button = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "StatusLine" },
},
close_button_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
close_button_visible = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
}
end
end,
}