Skip to content

Commit

Permalink
fix(cli): clear highlighter highlights before reloading the colorscheme
Browse files Browse the repository at this point in the history
Old highlights were remembered and that led to unexpected behaviour with, for example, Telescope, when toggling transparency. The highlight groups set for Telescope are very different in transparent mode vs non-transparent mode.
  • Loading branch information
ramojus committed Nov 2, 2024
1 parent faca971 commit 3fe886b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/mellifluous/cli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function M.create()
return
end

require("mellifluous.utils.highlighter").clear_highlights()
vim.cmd("colorscheme mellifluous")
end, {
nargs = 1,
Expand Down
4 changes: 4 additions & 0 deletions lua/mellifluous/utils/highlighter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ function M.apply_all()
end
end

function M.clear_highlights()
highlights = {}
end

return M

0 comments on commit 3fe886b

Please sign in to comment.