fix(dap.hover): clean up constructors
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ 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
|
||||||
|
return instance
|
||||||
|
end
|
||||||
|
|
||||||
instance = setmetatable({
|
instance = setmetatable({
|
||||||
max_width = nil,
|
max_width = nil,
|
||||||
max_height = nil,
|
max_height = nil,
|
||||||
@@ -28,7 +31,6 @@ function Window.get_instance()
|
|||||||
bufnr = nil,
|
bufnr = nil,
|
||||||
augroup = nil,
|
augroup = nil,
|
||||||
}, Window)
|
}, Window)
|
||||||
end
|
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user