Skip to content

[Bug]: LSP server add some weird background color to the existing tabs.Β #1024

Open

Description

@pwang2

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When LSP is disabled, the tab looks as configured βœ….

Image

When LSPStart jdtls, the tab looks like something awkward πŸ˜”. Even after removing the diagnostics count here. still the same.

Image

What did you expect to happen?

LSP server should not affect bufferline rendering.

Config

return {
  "akinsho/bufferline.nvim",
  event = "BufReadPost", 
  config = function()
    local bufferline = require("bufferline")
    local inactive_bg = "#1c1c1c"
    local inactive_fg = "#e0e0e0"
    local visible_bg = "#0e0e0e"
    local visible_fg = "#5c6370"
    local selected_bg = "#282c34"
    local selected_fg = "#00afff"
    local background = "#1c1c1c"
    local inactive_set = { fg = inactive_fg, bg = inactive_bg }
    local visible_set = { fg = visible_fg, bg = visible_bg }
    local active_set = { fg = selected_fg, bg = selected_bg }
    bufferline.setup({
      highlights = {
        background = inactive_set,
        buffer_visible = visible_set,
        buffer_selected = active_set,

        numbers = inactive_set,
        numbers_visible = visible_set,
        numbers_selected = active_set,

        close_button = inactive_set,
        close_button_visible = visible_set,
        close_button_selected = active_set,

        offset_separator = { fg = "#585858", bg = selected_bg },

        separator = { fg = background, bg = inactive_bg },
        separator_visible = { fg = background, bg = visible_bg },
        separator_selected = { fg = background, bg = selected_bg },

        modified = { fg = "#ff0000", bg = inactive_bg },
        modified_visible = { fg = "#ff0000", bg = visible_bg },
        modified_selected = { fg = "#ff0000", bg = selected_bg },
        fill = { bg = background },
      },
      options = {
        mode = "buffers", -- set to "tabs" to only show tabpages instead
        style_preset = bufferline.style_preset.default, -- or bufferline.style_preset.minimal,
        themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
        numbers = "both", -- "none" | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
        diagnostics = "nvim_lsp",
        diagnostics_update_on_event = true, -- use nvim's diagnostic handler
        diagnostics_indicator = function(count)
          return "(" .. count .. ")"
        end,
        color_icons = true,
        separator_style = "slant", -- "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
        always_show_bufferline = true,
        indicator = {
          icon = "β–Ž", -- this should be omitted if indicator style is not 'icon'
          style = "icon", --"icon" | "underline" | "none",
        },
        offsets = {
          {
            filetype = "NvimTree",
            text = "",
            highlight = "Directory",
            separator = true, -- use a "true" to enable the default, or set your own character
          },
        },
      },
    })
  end,
}

Additional Information

comment out these lines will fix the rendering. but I do want to have the diagnostic count in the tab.

        -- diagnostics = "nvim_lsp",
        -- diagnostics_update_on_event = true, -- use nvim's diagnostic handler
        -- diagnostics_indicator = function(count)
        --   return "(" .. count .. ")"
        -- end,

...

commit

No response

Activity

  1. added
    bug
    on Jun 23, 2025
  2. syevt commented on Apr 19, 2026

    @syevt

    Just use

    event = "VeryLazy"

    in the bufferline.nvim config file. It looks like lazy.nvim loads the color scheme after bufferlne.nvim so it cannot get the right colors. You could check with :color <your scheme> after loading. If that works then fixing race conditions should help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions