Skip to content

Commit

Permalink
fix(window): winhl was not always applied
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 16, 2024
1 parent 1afa13e commit 1f4e1ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/edgy/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ function M:fix_winhl()
if not vim.api.nvim_win_is_valid(self.win) then
return
end
local v = self.wo.winhighlight
local current = vim.wo[self.win].winhighlight
-- special treatment for winhighlight
-- add to existing winhighlight
local whl = vim.split(vim.wo[self.win].winhighlight, ",")
vim.list_extend(whl, vim.split(v, ","))
local whl = vim.split(current, ",")
vim.list_extend(whl, vim.split(self.wo.winhighlight, ","))
local have = { [""] = true }
whl = vim.tbl_filter(function(hl)
if have[hl] then
Expand All @@ -90,7 +90,7 @@ function M:fix_winhl()
return true
end, whl)
local newv = table.concat(whl, ",")
if newv == v then
if newv == current then
return
end
vim.api.nvim_set_option_value("winhighlight", newv, { scope = "local", win = self.win })
Expand Down

0 comments on commit 1f4e1ef

Please sign in to comment.