Skip to content

Commit

Permalink
fix(hooks): use hooks to set highlights when changing colorschemes
Browse files Browse the repository at this point in the history
  • Loading branch information
daUnknownCoder committed Feb 25, 2024
1 parent 74697ed commit 0402846
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lua/NeutronVim/plugins/UI/indents_delims.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ return {
"RainbowCyan",
}

vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
local hooks = require "ibl.hooks"
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)

vim.g.rainbow_delimiters = { highlight = highlight }

Expand All @@ -38,8 +41,10 @@ return {
},
scope = {
enabled = true,
highlight = highlight,
},
})
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
end,
},
{
Expand Down

0 comments on commit 0402846

Please sign in to comment.