Skip to content

Commit

Permalink
fix: don't set window properties when nil
Browse files Browse the repository at this point in the history
Closes #407
  • Loading branch information
Saghen committed Nov 29, 2024
1 parent ea61b1d commit cb815af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/blink/cmp/lib/window/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ function win:open()
if self.scrollbar then self.scrollbar:mount(self.id) end
end

function win:set_option_value(option, value) vim.api.nvim_set_option_value(option, value, { win = self.id }) end
function win:set_option_value(option, value)
if self.id == nil or not vim.api.nvim_win_is_valid(self.id) then return end
vim.api.nvim_set_option_value(option, value, { win = self.id })
end

function win:close()
if self.id ~= nil then
Expand Down

0 comments on commit cb815af

Please sign in to comment.