From 65742f3b9306bd6167e3e8561504932a0e3189ee Mon Sep 17 00:00:00 2001 From: Simrat Grewal Date: Thu, 11 Aug 2022 14:55:54 -0700 Subject: [PATCH] feat(ui): Improve FocusedSymbol highlight --- lua/symbols-outline/ui.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/symbols-outline/ui.lua b/lua/symbols-outline/ui.lua index 5d3936e..325f901 100644 --- a/lua/symbols-outline/ui.lua +++ b/lua/symbols-outline/ui.lua @@ -28,7 +28,14 @@ function M.setup_highlights() -- Setup the FocusedSymbol highlight group if it hasn't been done already by -- a theme or manually set if vim.fn.hlexists 'FocusedSymbol' == 0 then - vim.cmd 'hi FocusedSymbol term=italic,bold cterm=italic ctermbg=yellow ctermfg=darkblue gui=bold,italic guibg=yellow guifg=darkblue' + local cline_hl = vim.api.nvim_get_hl_by_name('CursorLine', true) + local string_hl = vim.api.nvim_get_hl_by_name('String', true) + + vim.api.nvim_set_hl( + 0, + 'FocusedSymbol', + { bg = cline_hl.background, fg = string_hl.foreground } + ) end -- Some colorschemes do some funky things with the comment highlight, most