#1216 show diagnostic signs on all folders (#1244)

This commit is contained in:
Alexander Courtis
2022-05-10 11:22:11 +10:00
committed by GitHub
parent 47732b6dbf
commit 82ec79aac5
4 changed files with 37 additions and 33 deletions

View File

@@ -123,6 +123,29 @@ function M.find_node(nodes, fn)
return node, i
end
-- return visible nodes indexed by line
-- @param nodes_all list of node
-- @param line_start first index
---@return table
function M.get_nodes_by_line(nodes_all, line_start)
local nodes_by_line = {}
local line = line_start
local function iter(nodes)
for _, node in ipairs(nodes) do
nodes_by_line[line] = node
line = line + 1
if node.open == true then
local child = iter(node.nodes)
if child ~= nil then
return child
end
end
end
end
iter(nodes_all)
return nodes_by_line
end
---Matching executable files in Windows.
---@param ext string
---@return boolean