Revert "use supers for node methods"

This reverts commit 9fc7a866ec.
This commit is contained in:
Alexander Courtis 2024-11-08 18:00:13 +11:00
parent 388439e639
commit 53fa471777
6 changed files with 11 additions and 11 deletions

View File

@ -28,7 +28,7 @@ function DirectoryLinkNode:new(args)
end
function DirectoryLinkNode:destroy()
self.super.destroy(self)
DirectoryNode.destroy(self)
end
---Update the directory git_status of link target and the file status of the link itself
@ -60,7 +60,7 @@ end
---Maybe override name with arrow
---@return HighlightedString name
function DirectoryLinkNode:highlighted_name()
local name = self.super.highlighted_name(self)
local name = DirectoryNode.highlighted_name(self)
if self.explorer.opts.renderer.symlink_destination then
local link_to = utils.path_relative(self.link_to, self.explorer.absolute_path)
@ -74,7 +74,7 @@ end
---Create a sanitized partial copy of a node, populating children recursively.
---@return DirectoryLinkNode cloned
function DirectoryLinkNode:clone()
local clone = self.super.clone(self) --[[@as DirectoryLinkNode]]
local clone = DirectoryNode.clone(self) --[[@as DirectoryLinkNode]]
clone.link_to = self.link_to
clone.fs_stat_target = self.fs_stat_target

View File

@ -1,7 +1,6 @@
local git_utils = require("nvim-tree.git.utils")
local icons = require("nvim-tree.renderer.components.devicons")
local notify = require("nvim-tree.notify")
local Node = require("nvim-tree.node")
---@class (exact) DirectoryNode: Node
@ -47,7 +46,7 @@ function DirectoryNode:destroy()
end
end
self.super.destroy(self)
Node.destroy(self)
end
---Update the git_status of the directory
@ -273,7 +272,7 @@ end
---Create a sanitized partial copy of a node, populating children recursively.
---@return DirectoryNode cloned
function DirectoryNode:clone()
local clone = self.super.clone(self) --[[@as DirectoryNode]]
local clone = Node.clone(self) --[[@as DirectoryNode]]
clone.has_children = self.has_children
clone.group_next = nil

View File

@ -21,7 +21,7 @@ function FileLinkNode:new(args)
end
function FileLinkNode:destroy()
self.super.destroy(self)
FileNode.destroy(self)
end
---Update the git_status of the target otherwise the link itself
@ -60,7 +60,7 @@ end
---Create a sanitized partial copy of a node
---@return FileLinkNode cloned
function FileLinkNode:clone()
local clone = self.super.clone(self) --[[@as FileLinkNode]]
local clone = FileNode.clone(self) --[[@as FileLinkNode]]
clone.link_to = self.link_to
clone.fs_stat_target = self.fs_stat_target

View File

@ -31,7 +31,7 @@ function FileNode:new(args)
end
function FileNode:destroy()
self.super.destroy(self)
Node.destroy(self)
end
---Update the GitStatus of the file
@ -96,7 +96,7 @@ end
---Create a sanitized partial copy of a node
---@return FileNode cloned
function FileNode:clone()
local clone = self.super.clone(self) --[[@as FileNode]]
local clone = Node.clone(self) --[[@as FileNode]]
clone.extension = self.extension

View File

@ -19,7 +19,7 @@ function RootNode:is_dotfile()
end
function RootNode:destroy()
self.super.destroy(self)
DirectoryNode.destroy(self)
end
return RootNode

View File

@ -4,6 +4,7 @@ local Class = require("nvim-tree.classic")
---@alias DecoratorIconPlacement "none" | "before" | "after" | "signcolumn" | "right_align"
---Abstract Decorator
---Uses the factory pattern to instantiate child instances.
---@class (exact) Decorator: Class
---@field protected explorer Explorer
---@field protected enabled boolean