refractor(parser): get_details: Use flattened_outline_items
This commit is contained in:
@@ -119,14 +119,10 @@ function M.get_lines(flattened_outline_items)
|
||||
return lines
|
||||
end
|
||||
|
||||
function M.get_details(outline_items, bufnr, winnr, lines)
|
||||
lines = lines or {}
|
||||
for _, value in ipairs(outline_items) do
|
||||
function M.get_details(flattened_outline_items)
|
||||
local lines = {}
|
||||
for _, value in ipairs(flattened_outline_items) do
|
||||
table.insert(lines, value.detail or "")
|
||||
|
||||
if value.children ~= nil then
|
||||
M.get_details(value.children, bufnr, winnr, lines)
|
||||
end
|
||||
end
|
||||
return lines
|
||||
end
|
||||
|
||||
@@ -32,12 +32,12 @@ end
|
||||
|
||||
-- runs the whole writing routine where the text is cleared, new data is parsed
|
||||
-- and then written
|
||||
function M.parse_and_write(bufnr, winnr, outline_items, flattened_outline_items)
|
||||
function M.parse_and_write(bufnr, flattened_outline_items)
|
||||
local lines = parser.get_lines(flattened_outline_items)
|
||||
M.write_outline(bufnr, lines)
|
||||
|
||||
clear_virt_text(bufnr)
|
||||
local details = parser.get_details(outline_items, bufnr, winnr)
|
||||
local details = parser.get_details(flattened_outline_items)
|
||||
M.write_details(bufnr, details)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user