chore: add type annotations to (almost) all functions
This commit is contained in:
@@ -4,18 +4,21 @@ local NvimTreeMarks = {}
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param node Node
|
||||
local function add_mark(node)
|
||||
NvimTreeMarks[node.absolute_path] = node
|
||||
|
||||
renderer.draw()
|
||||
end
|
||||
|
||||
---@param node Node
|
||||
local function remove_mark(node)
|
||||
NvimTreeMarks[node.absolute_path] = nil
|
||||
|
||||
renderer.draw()
|
||||
end
|
||||
|
||||
---@param node Node
|
||||
function M.toggle_mark(node)
|
||||
if node.absolute_path == nil then
|
||||
return
|
||||
@@ -36,10 +39,13 @@ function M.clear_marks()
|
||||
renderer.draw()
|
||||
end
|
||||
|
||||
---@param node Node
|
||||
---@return table|nil
|
||||
function M.get_mark(node)
|
||||
return NvimTreeMarks[node.absolute_path]
|
||||
end
|
||||
|
||||
---@return table
|
||||
function M.get_marks()
|
||||
local list = {}
|
||||
for _, node in pairs(NvimTreeMarks) do
|
||||
|
||||
Reference in New Issue
Block a user