Skip to content

Commit

Permalink
fix: ignore cleared highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Jun 11, 2023
1 parent a2dcd45 commit 6b1f32d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lua/fzf-lua/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ function M.setup_highlights()
config.set_global(v[1]:gsub("%.hl%.", ".__hl."), hl_name)
end

for _, v in pairs(highlights) do
for _, a in pairs(highlights) do
local _, v = a[1], a[2]
local opt_path = v[1]:gsub("%.hl%.", ".__hl.")
local hl = config.get_global(opt_path)
if utils.is_hl_cleared(hl) then
Expand Down
4 changes: 3 additions & 1 deletion lua/fzf-lua/win.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ function FzfWin:reset_win_highlights(win)
end
local hl
for _, h in ipairs(self.winopts.__winhls[key]) do
hl = string.format("%s%s:%s", hl and hl .. "," or "", h[1], h[2])
if h[2] then
hl = string.format("%s%s:%s", hl and hl .. "," or "", h[1], h[2])
end
end
vim.api.nvim_win_set_option(win, "winhighlight", hl)
end
Expand Down

0 comments on commit 6b1f32d

Please sign in to comment.