Skip to content

Commit

Permalink
fix: properly dim all windows when Twilight is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Aug 5, 2021
1 parent f722fa2 commit 30ef601
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/twilight/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ function M.enable()
autocmd ColorScheme * lua require("twilight.config").colors()
augroup end]])
M.started = true
M.update()
for _, win in ipairs(vim.api.nvim_list_wins()) do
M.update(win)
end
end
end

Expand Down Expand Up @@ -207,8 +209,8 @@ function M.is_valid_buf(buf)
return true
end

function M.update()
local win = vim.api.nvim_get_current_win()
function M.update(win)
win = win or vim.api.nvim_get_current_win()

if not M.enabled or not vim.api.nvim_win_is_valid(win) then
return false
Expand Down

0 comments on commit 30ef601

Please sign in to comment.