nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.42k stars 286 forks source link

Breadcrumb highlighting bug #1333

Closed KritPaoIn closed 10 months ago

KritPaoIn commented 10 months ago

Describe the bug

Screenshot 2023-10-22 at 2 26 18 AM

Steps to reproduce

local lspsaga = require("lspsaga")

lspsaga.setup({
    diagnostic = {
        on_insert = false,
        show_virt_line = false,
    },
    saga_winblend = 0,
    move_in_saga = { prev = "<C-p>", next = "<C-n>" },
    max_preview_lines = 10,
    code_action_num_shortcut = true,
    ui = {
        border = "rounded",
        code_action = "",
        kind = {
            Folder = { " " },
            Module = { " ", "@namespace" },
            Namespace = { " ", "@namespace" },
            Package = { " ", "@namespace" },
            Class = { " ", "@type" },
            Method = { " ", "@method" },
            Property = { " ", "LineNr" },
            Field = { " ", "@field" },
            Constructor = { " ", "@constructor" },
            Enum = { " ", "@type" },
            Interface = { " ", "@type" },
            Function = { " ", "@function" },
            Variable = { " ", "@constant" },
            Constant = { " ", "@constant" },
            String = { " ", "@string" },
            Number = { "󰎠 ", "@number" },
            Boolean = { " ", "@boolean" },
            Array = { " ", "@constant" },
            Object = { " ", "@type" },
            Key = { " ", "@type" },
            Null = { "󰟢 ", "@type" },
            EnumMember = { " ", "@field" },
            Struct = { " ", "@type" },
            Event = { "󱐋 ", "@type" },
            Operator = { " ", "@operator" },
            TypeParameter = { " ", "@parameter" },
            Parameter = { " ", "@parameter" },
        },
    },
    lightbulb = {
        enable = true,
        sign = true,
        virtual_text = false,
    },
    code_action_keys = {
        quit = "q",
        exec = "<CR>",
    },
    definition_action_keys = {
        edit = "<C-c>o",
        vsplit = "<C-c>v",
        split = "<C-c>i",
        tabe = "<C-c>t",
        quit = "q",
    },
    rename_action_quit = "<C-c>",
    rename_in_select = true,
    symbol_in_winbar = {
        enable = true,
        show_file = true,
        separator = "  ",
        color_mode = false,
    },
    server_filetype_map = {},
})

Expected behavior

no bug

Neovim version (nvim -v)

0.9.1

lspsaga commit

28051f1be64c85aaeb9272de072cd9a13dfa5150

Terminal name/version

iTerm Build 3.5.0beta10

savchenko commented 10 months ago

Another, simpler way to reproduce this bug. Via lazy.nvim:

{
  url = 'https://github.com/nvimdev/lspsaga.nvim',
  opts = {
    symbol_in_winbar = {
      hide_keyword = true,
      show_file = false,
      folder_level = 0,
      color_mode = false
    }
  }
}
glepnir commented 10 months ago

emmm which colorscheme ?

savchenko commented 10 months ago

emmm which colorscheme ?

https://github.com/rebelot/kanagawa.nvim

qRoC commented 10 months ago

That because https://github.com/nvimdev/lspsaga.nvim/blob/main/lua/lspsaga/symbol/winbar.lua#L104C31-L104C44 must be:

elements[#elements + 1] = string.format(
      '%s%s#%s%sWord#%s',
      bar.prefix,
      type,
      icon,
      bar.prefix,
      node.name
    )