From dc96a12dd85d98a3fadd9027558777d2db886e2a Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 13 Oct 2024 10:00:00 +0200 Subject: [PATCH] fix(menu): ensure to not match on nil value --- lua/care/menu/init.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/care/menu/init.lua b/lua/care/menu/init.lua index 95b519d..c324ed9 100644 --- a/lua/care/menu/init.lua +++ b/lua/care/menu/init.lua @@ -45,10 +45,7 @@ function Menu:draw_docs(entry) local function open_docs_window(doc_entry) local config = self.config.ui.docs_view or {} local completion_item = doc_entry.completion_item - if - not completion_item.documentation and not completion_item.detail - or (completion_item.documentation:match("^%s*$") and completion_item.detail:match("^%s*$")) - then + if (completion_item.documentation or ""):match("^%s*$") and (completion_item.detail or ""):match("^%s*$") then self.docs_window:close() return end