Skip to content

Commit

Permalink
fix: default highlight group in nav view is NormalFloat (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jul 30, 2023
1 parent d49d62b commit 2a6498f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/aerial/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ M.create_highlight_groups = function()
default = true,
})

-- Set another group for NormalFloat, for use in the nav view
local normal_float_defn = vim.api.nvim_get_hl_by_name("NormalFloat", true)
-- Don't set the background for the float so that it blends nicely with the cursorline
vim.api.nvim_set_hl(0, "AerialNormalFloat", {
fg = normal_float_defn.foreground,
ctermfg = normal_float_defn.ctermfg,
blend = normal_float_defn.blend,
default = true,
})

-- The line that shows where your cursor(s) are
link("AerialLine", "QuickFixLine")
link("AerialLineNC", "AerialLine")
Expand Down
7 changes: 7 additions & 0 deletions lua/aerial/nav_view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ function AerialNav.new(bufnr, winid)
border = config.nav.border,
style = "minimal",
})
for _, floatwin in ipairs({ left_win, main_win, right_win }) do
vim.api.nvim_set_option_value(
"winhighlight",
"AerialNormal:AerialNormalFloat",
{ scope = "local", win = floatwin }
)
end
local nav = setmetatable({
winid = winid,
bufnr = bufnr,
Expand Down

0 comments on commit 2a6498f

Please sign in to comment.