Skip to content

Commit

Permalink
fix(menu): avoid calling match on table value
Browse files Browse the repository at this point in the history
  • Loading branch information
max397574 committed Oct 20, 2024
1 parent dc96a12 commit 06ede94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/care/menu/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ 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 (completion_item.documentation or ""):match("^%s*$") and (completion_item.detail or ""):match("^%s*$") then
local documentation = completion_item.documentation
if
(documentation.value or documentation or ""):match("^%s*$")
and (completion_item.detail or ""):match("^%s*$")
then
self.docs_window:close()
return
end
local documentation = completion_item.documentation
local format = "markdown"
local contents
if type(documentation) == "table" and documentation.kind == "plaintext" then
Expand Down

0 comments on commit 06ede94

Please sign in to comment.