Skip to content

Commit

Permalink
feat(hls): FzfLuaLiveSym live workspace symbols matches (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Feb 28, 2024
1 parent 785e7db commit 85c0972
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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|

<sup><sub>&ast;Not a highlight group, RGB color from `nvim_get_color_map`</sub></sup>

Expand Down
2 changes: 2 additions & 0 deletions lua/fzf-lua/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -962,6 +963,7 @@ M.defaults.__HLS = {
tab_title = "FzfLuaTabTitle",
tab_marker = "FzfLuaTabMarker",
dir_icon = "FzfLuaDirIcon",
live_sym = "FzfLuaLiveSym",
}

M.defaults.__WINOPTS = {
Expand Down
1 change: 1 addition & 0 deletions lua/fzf-lua/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/providers/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85c0972

Please sign in to comment.