This reverts commit 38aac09151.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local notify = require("nvim-tree.notify")
|
||||
local explorer_node = require("nvim-tree.explorer.node")
|
||||
|
||||
local HL_POSITION = require("nvim-tree.enum").HL_POSITION
|
||||
local ICON_PLACEMENT = require("nvim-tree.enum").ICON_PLACEMENT
|
||||
@@ -9,25 +10,23 @@ local Decorator = require("nvim-tree.renderer.decorator")
|
||||
---@field ord number decreasing priority
|
||||
|
||||
---@class (exact) DecoratorGit: Decorator
|
||||
---@field file_hl table<string, string>? by porcelain status e.g. "AM"
|
||||
---@field folder_hl table<string, string>? by porcelain status
|
||||
---@field icons_by_status HighlightedStringGit[]? by human status
|
||||
---@field icons_by_xy table<string, HighlightedStringGit[]>? by porcelain status
|
||||
---@field file_hl table<string, string> by porcelain status e.g. "AM"
|
||||
---@field folder_hl table<string, string> by porcelain status
|
||||
---@field icons_by_status HighlightedStringGit[] by human status
|
||||
---@field icons_by_xy table<string, HighlightedStringGit[]> by porcelain status
|
||||
local DecoratorGit = Decorator:new()
|
||||
|
||||
---Static factory method
|
||||
---@param opts table
|
||||
---@param explorer Explorer
|
||||
---@return DecoratorGit
|
||||
function DecoratorGit:create(opts, explorer)
|
||||
---@type DecoratorGit
|
||||
local o = {
|
||||
function DecoratorGit:new(opts, explorer)
|
||||
local o = Decorator.new(self, {
|
||||
explorer = explorer,
|
||||
enabled = opts.git.enable,
|
||||
hl_pos = HL_POSITION[opts.renderer.highlight_git] or HL_POSITION.none,
|
||||
icon_placement = ICON_PLACEMENT[opts.renderer.icons.git_placement] or ICON_PLACEMENT.none,
|
||||
}
|
||||
o = self:new(o) --[[@as DecoratorGit]]
|
||||
})
|
||||
---@cast o DecoratorGit
|
||||
|
||||
if not o.enabled then
|
||||
return o
|
||||
@@ -148,7 +147,7 @@ function DecoratorGit:calculate_icons(node)
|
||||
return nil
|
||||
end
|
||||
|
||||
local git_status = node:get_git_status()
|
||||
local git_status = explorer_node.get_git_status(node)
|
||||
if git_status == nil then
|
||||
return nil
|
||||
end
|
||||
@@ -209,7 +208,7 @@ function DecoratorGit:calculate_highlight(node)
|
||||
return nil
|
||||
end
|
||||
|
||||
local git_status = node:get_git_status()
|
||||
local git_status = explorer_node.get_git_status(node)
|
||||
if not git_status then
|
||||
return nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user