diff --git a/lua/ow/dap/hover/node.lua b/lua/ow/dap/hover/node.lua index e8e8061..1e93ca7 100644 --- a/lua/ow/dap/hover/node.lua +++ b/lua/ow/dap/hover/node.lua @@ -11,15 +11,13 @@ Node.__index = Node ---@param parent ow.dap.hover.Node? ---@return ow.dap.hover.Node function Node.new(item, parent) - local node = setmetatable({ + return setmetatable({ item = item, parent = parent, children = {}, is_expanded = false, is_last_child = false, }, Node) - - return node end ---@return boolean diff --git a/lua/ow/dap/hover/window.lua b/lua/ow/dap/hover/window.lua index 9f50884..eb4ded4 100644 --- a/lua/ow/dap/hover/window.lua +++ b/lua/ow/dap/hover/window.lua @@ -20,16 +20,18 @@ local instance = nil ---@return ow.dap.hover.Window function Window.get_instance() - if not instance then - instance = setmetatable({ - max_width = nil, - max_height = nil, - winid = nil, - bufnr = nil, - augroup = nil, - }, Window) + if instance then + return instance end + instance = setmetatable({ + max_width = nil, + max_height = nil, + winid = nil, + bufnr = nil, + augroup = nil, + }, Window) + return instance end