From 790369bb9998d1f9a01f67378e407622b492cf69 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Fri, 13 Dec 2024 00:20:20 -0500 Subject: [PATCH] fix: check that scrollbar is not nil Closes #525 --- lua/blink/cmp/completion/windows/documentation.lua | 2 +- lua/blink/cmp/completion/windows/menu.lua | 2 +- lua/blink/cmp/signature/window.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/blink/cmp/completion/windows/documentation.lua b/lua/blink/cmp/completion/windows/documentation.lua index d2f2b56..f9ca2eb 100644 --- a/lua/blink/cmp/completion/windows/documentation.lua +++ b/lua/blink/cmp/completion/windows/documentation.lua @@ -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 diff --git a/lua/blink/cmp/completion/windows/menu.lua b/lua/blink/cmp/completion/windows/menu.lua index c60408c..69285d3 100644 --- a/lua/blink/cmp/completion/windows/menu.lua +++ b/lua/blink/cmp/completion/windows/menu.lua @@ -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() diff --git a/lua/blink/cmp/signature/window.lua b/lua/blink/cmp/signature/window.lua index 3864b0b..e6d89fd 100644 --- a/lua/blink/cmp/signature/window.lua +++ b/lua/blink/cmp/signature/window.lua @@ -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