refacto: ubiquitous language renaming
BREAKING - rename all 'entry' to 'node' or '_node' if shadowing - rename all 'entries' to 'nodes'
This commit is contained in:
@@ -284,7 +284,7 @@ local function update_draw_data(tree, depth, markers)
|
||||
index = 1
|
||||
end
|
||||
|
||||
for idx, node in ipairs(tree.entries) do
|
||||
for idx, node in ipairs(tree.nodes) do
|
||||
local padding = _padding.get_padding(depth, idx, tree, node, markers)
|
||||
local offset = string.len(padding)
|
||||
if depth > 0 then
|
||||
@@ -293,8 +293,8 @@ local function update_draw_data(tree, depth, markers)
|
||||
|
||||
local git_hl = get_git_hl(node)
|
||||
|
||||
if node.entries then
|
||||
local has_children = #node.entries ~= 0 or node.has_children
|
||||
if node.nodes then
|
||||
local has_children = #node.nodes ~= 0 or node.has_children
|
||||
local icon = get_folder_icon(node.open, node.link_to ~= nil, has_children)
|
||||
local git_icon = get_git_icons(node, index, offset, #icon) or ""
|
||||
-- INFO: this is mandatory in order to keep gui attributes (bold/italics)
|
||||
|
||||
@@ -6,7 +6,7 @@ end
|
||||
|
||||
local function get_padding_arrows(icon_state)
|
||||
return function(depth, _, _, node)
|
||||
if node.entries then
|
||||
if node.nodes then
|
||||
local icon = icon_state.icons.folder_icons[node.open and 'arrow_open' or 'arrow_closed']
|
||||
return string.rep(' ', depth - 2)..icon..' '
|
||||
end
|
||||
@@ -18,9 +18,9 @@ local function get_padding_indent_markers(depth, idx, tree, _, markers)
|
||||
local padding = ""
|
||||
if depth ~= 0 then
|
||||
local rdepth = depth/2
|
||||
markers[rdepth] = idx ~= #tree.entries
|
||||
markers[rdepth] = idx ~= #tree.nodes
|
||||
for i=1,rdepth do
|
||||
if idx == #tree.entries and i == rdepth then
|
||||
if idx == #tree.nodes and i == rdepth then
|
||||
padding = padding..'└ '
|
||||
elseif markers[i] then
|
||||
padding = padding..'│ '
|
||||
|
||||
Reference in New Issue
Block a user