From b1d93205da9f3fd981170d4b7345f459fefeab89 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 2 Nov 2024 14:01:41 +0100 Subject: [PATCH] feat(menu): readjust docs window fixes https://github.com/max397574/care.nvim/issues/89 --- lua/care/menu/init.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lua/care/menu/init.lua b/lua/care/menu/init.lua index 2ca44c7..f65b03b 100644 --- a/lua/care/menu/init.lua +++ b/lua/care/menu/init.lua @@ -147,11 +147,15 @@ function Menu:draw_docs(entry) local docs_view_conf = self.config.ui.docs_view or {} - self.docs_window:open_cursor_relative(width, height, win_offset, { - border = docs_view_conf.border, - position = self.menu_window.position, - max_height = docs_view_conf.max_height, - }) + if self.docs_window:is_open() then + self.docs_window:readjust(height, width, win_offset) + else + self.docs_window:open_cursor_relative(width, height, win_offset, { + border = docs_view_conf.border, + position = self.menu_window.position, + max_height = docs_view_conf.max_height, + }) + end self.docs_window:set_scroll(1, 1, false) self.docs_window:draw_scrollbar()