Skip to content

Commit

Permalink
Merge pull request #23 from yujinyuz/fix-key-not-found
Browse files Browse the repository at this point in the history
fix: prevent 'Key not found' error when checking for shaded window
  • Loading branch information
miversen33 authored Aug 13, 2024
2 parents 11896b9 + 013f569 commit f986b69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/sunglasses/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function Window:config(window_options)
end

function Window:is_shaded()
return vim.api.nvim_win_get_var(self.window, 'Sunglasses')
local ok, _ = pcall(vim.api.nvim_win_get_var, self.window, 'Sunglasses')
return ok
end

function Window:can_shade()
Expand Down

0 comments on commit f986b69

Please sign in to comment.