diff --git a/README.md b/README.md index 1d2593c1..d55b4c7d 100644 --- a/README.md +++ b/README.md @@ -1304,6 +1304,7 @@ temporarily overridden by its corresponding `winopts` option: |FzfLuaTabTitle |*LightSkyBlue1 |`hls.tab_title` |Tab title (`tabs`)| |FzfLuaTabMarker |*BlanchedAlmond |`hls.tab_marker` |Tab marker (`tabs`)| |FzfLuaDirIcon |Directory |`hls.dir_icon` |Paths directory icon| +|FzfLuaLiveSym |*Brown1 |`hls.live_sym` |LSP live symbols query match| *Not a highlight group, RGB color from `nvim_get_color_map` diff --git a/lua/fzf-lua/defaults.lua b/lua/fzf-lua/defaults.lua index 23b1f785..8c78e67e 100644 --- a/lua/fzf-lua/defaults.lua +++ b/lua/fzf-lua/defaults.lua @@ -662,6 +662,7 @@ M.defaults.lsp.symbols = { }, _actions = function() return M.globals.actions.files end, actions = { ["ctrl-g"] = { actions.sym_lsym } }, + _cached_hls = { "live_sym" }, } M.defaults.lsp.finder = { @@ -962,6 +963,7 @@ M.defaults.__HLS = { tab_title = "FzfLuaTabTitle", tab_marker = "FzfLuaTabMarker", dir_icon = "FzfLuaDirIcon", + live_sym = "FzfLuaLiveSym", } M.defaults.__WINOPTS = { diff --git a/lua/fzf-lua/init.lua b/lua/fzf-lua/init.lua index 022f1a18..0ec6c52e 100644 --- a/lua/fzf-lua/init.lua +++ b/lua/fzf-lua/init.lua @@ -70,6 +70,7 @@ function M.setup_highlights(override) { "FzfLuaTabTitle", "tab_title", { default = default, fg = "LightSkyBlue1", bold = true } }, { "FzfLuaTabMarker", "tab_marker", { default = default, fg = "BlanchedAlmond", bold = true } }, { "FzfLuaDirIcon", "dir_icon", { default = default, link = "Directory" } }, + { "FzfLuaLiveSym", "live_sym", { default = default, fg = "Brown1" } }, } for _, a in ipairs(highlights) do local hl_name, _, hl_def = a[1], a[2], a[3] diff --git a/lua/fzf-lua/providers/lsp.lua b/lua/fzf-lua/providers/lsp.lua index 77f7d6fb..a93da341 100644 --- a/lua/fzf-lua/providers/lsp.lua +++ b/lua/fzf-lua/providers/lsp.lua @@ -200,7 +200,7 @@ local function symbol_handler(opts, cb, _, result, _, _) end) ) .. "]+" entry.text = sym .. text:gsub(pattern, function(x) - return utils.ansi_codes.red(x) + return utils.ansi_codes[opts.hls.live_sym](x) end) end if M._sym2style then