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

Bufferline diagnostics breaking colours #168

Open
uthmanmoh opened this issue Feb 3, 2024 · 0 comments
Open

Bufferline diagnostics breaking colours #168

uthmanmoh opened this issue Feb 3, 2024 · 0 comments

Comments

@uthmanmoh
Copy link

image

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,
  }
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

No branches or pull requests

1 participant