fix(dap.hover): clean up constructors

This commit is contained in:
2025-09-27 02:32:14 +02:00
parent b91ab499de
commit e3f8b2ce15
2 changed files with 11 additions and 11 deletions
+1 -3
View File
@@ -11,15 +11,13 @@ Node.__index = Node
---@param parent ow.dap.hover.Node? ---@param parent ow.dap.hover.Node?
---@return ow.dap.hover.Node ---@return ow.dap.hover.Node
function Node.new(item, parent) function Node.new(item, parent)
local node = setmetatable({ return setmetatable({
item = item, item = item,
parent = parent, parent = parent,
children = {}, children = {},
is_expanded = false, is_expanded = false,
is_last_child = false, is_last_child = false,
}, Node) }, Node)
return node
end end
---@return boolean ---@return boolean
+10 -8
View File
@@ -20,16 +20,18 @@ local instance = nil
---@return ow.dap.hover.Window ---@return ow.dap.hover.Window
function Window.get_instance() function Window.get_instance()
if not instance then if instance then
instance = setmetatable({ return instance
max_width = nil,
max_height = nil,
winid = nil,
bufnr = nil,
augroup = nil,
}, Window)
end end
instance = setmetatable({
max_width = nil,
max_height = nil,
winid = nil,
bufnr = nil,
augroup = nil,
}, Window)
return instance return instance
end end