Skip to content

Commit

Permalink
chore: resolve undefined-field
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-courtis committed Oct 29, 2024
1 parent e38c387 commit 0e9b844
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/nvim-tree/renderer/builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function Builder:unwrap_highlighted_strings(highlighted_strings)
end

---@private
---@param node Node
---@param node DirectoryNode
---@return HighlightedString icon
---@return HighlightedString name
function Builder:build_folder(node)
Expand Down Expand Up @@ -352,15 +352,19 @@ end
---@param idx integer line number starting at 1
---@param num_children integer of node
function Builder:build_line(node, idx, num_children)
local dir = node:as(DirectoryNode)
local dir_link = node:as(FileLinkNode)
local file_link = node:as(DirectoryLinkNode)

-- various components
local indent_markers = pad.get_indent_markers(self.depth, idx, num_children, node, self.markers)
local arrows = pad.get_arrows(node)

-- main components
local icon, name
if node:is(DirectoryNode) then
icon, name = self:build_folder(node)
elseif node:is(DirectoryLinkNode) or node:is(FileLinkNode) then
if dir then
icon, name = self:build_folder(dir)
elseif dir_link or file_link then
icon, name = self:build_symlink(node)
else
icon, name = self:build_file(node)
Expand Down

0 comments on commit 0e9b844

Please sign in to comment.