Skip to content

Commit

Permalink
fix: check that scrollbar is not nil
Browse files Browse the repository at this point in the history
Closes #525
  • Loading branch information
Saghen committed Dec 13, 2024
1 parent ad17735 commit 790369b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/blink/cmp/completion/windows/documentation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function docs.update_position()
end
end

docs.win.scrollbar:update(winnr)
if docs.win.scrollbar then docs.win.scrollbar:update(winnr) end
end

return docs
2 changes: 1 addition & 1 deletion lua/blink/cmp/completion/windows/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function menu.update_position()
end

vim.api.nvim_win_set_height(winnr, pos.height)
win.scrollbar:update(winnr)
if win.scrollbar then win.scrollbar:update(winnr) end

menu.position_update_emitter:emit()
menu.redraw_if_needed()
Expand Down
2 changes: 1 addition & 1 deletion lua/blink/cmp/signature/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function signature.update_position()
vim.api.nvim_win_set_config(winnr, { relative = 'cursor', row = pos.direction == 's' and 1 or -height, col = 0 })
end

win.scrollbar:update(winnr)
if win.scrollbar then win.scrollbar:update(winnr) end
end

return signature

0 comments on commit 790369b

Please sign in to comment.