Skip to content

Commit

Permalink
feat: add new AerialNormal highlight as a fallback for all text (#278)
Browse files Browse the repository at this point in the history
* feat: add new `AerialNormal` highlight as a fallback for all text

* [docgen] Update docs
skip-checks: true

---------

Co-authored-by: Github Actions <actions@github>
  • Loading branch information
mehalter and Github Actions committed Jul 11, 2023
1 parent 66078ea commit b4eb257
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,9 @@ hi link AerialClassIcon Special
hi link AerialFunction Special
hi AerialFunctionIcon guifg=#cb4b16 guibg=NONE guisp=NONE gui=NONE cterm=NONE
" There's also this group for the fallback of the text if a specific
" class highlight isn't defined
hi link AerialNormal Normal
" There's also this group for the cursor position
hi link AerialLine QuickFixLine
" If highlight_mode="split_width", you can set a separate color for the
Expand Down
14 changes: 13 additions & 1 deletion lua/aerial/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ M.get_highlight = function(symbol, is_icon, is_collapsed)
end

M.create_highlight_groups = function()
-- Use Normal colors for AerialNormal, while stripping bold/italic/etc
local normal_defn = vim.api.nvim_get_hl_by_name("Normal", true)
-- The default text highlight
vim.api.nvim_set_hl(0, "AerialNormal", {
fg = normal_defn.foreground,
bg = normal_defn.background,
ctermfg = normal_defn.ctermfg,
ctermbg = normal_defn.ctermbg,
blend = normal_defn.blend,
default = true,
})

-- The line that shows where your cursor(s) are
link("AerialLine", "QuickFixLine")
link("AerialLineNC", "AerialLine")
Expand All @@ -80,7 +92,7 @@ M.create_highlight_groups = function()

-- The name of the symbol
for _, symbol_kind in ipairs(symbol_kinds) do
link(string.format("Aerial%s", symbol_kind), "NONE")
link(string.format("Aerial%s", symbol_kind), "AerialNormal")
end

-- The icon displayed to the left of the symbol
Expand Down

0 comments on commit b4eb257

Please sign in to comment.