Skip to content

Commit 9fc7a86

Browse files
committed
use supers for node methods
1 parent 92fa490 commit 9fc7a86

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

lua/nvim-tree/node/directory-link.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function DirectoryLinkNode:new(args)
2828
end
2929

3030
function DirectoryLinkNode:destroy()
31-
DirectoryNode.destroy(self)
31+
self.super.destroy(self)
3232
end
3333

3434
---Update the directory git_status of link target and the file status of the link itself
@@ -60,7 +60,7 @@ end
6060
---Maybe override name with arrow
6161
---@return HighlightedString name
6262
function DirectoryLinkNode:highlighted_name()
63-
local name = DirectoryNode.highlighted_name(self)
63+
local name = self.super.highlighted_name(self)
6464

6565
if self.explorer.opts.renderer.symlink_destination then
6666
local link_to = utils.path_relative(self.link_to, self.explorer.absolute_path)
@@ -74,7 +74,7 @@ end
7474
---Create a sanitized partial copy of a node, populating children recursively.
7575
---@return DirectoryLinkNode cloned
7676
function DirectoryLinkNode:clone()
77-
local clone = DirectoryNode.clone(self) --[[@as DirectoryLinkNode]]
77+
local clone = self.super.clone(self) --[[@as DirectoryLinkNode]]
7878

7979
clone.link_to = self.link_to
8080
clone.fs_stat_target = self.fs_stat_target

lua/nvim-tree/node/directory.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local git_utils = require("nvim-tree.git.utils")
22
local icons = require("nvim-tree.renderer.components.devicons")
33
local notify = require("nvim-tree.notify")
4+
45
local Node = require("nvim-tree.node")
56

67
---@class (exact) DirectoryNode: Node
@@ -46,7 +47,7 @@ function DirectoryNode:destroy()
4647
end
4748
end
4849

49-
Node.destroy(self)
50+
self.super.destroy(self)
5051
end
5152

5253
---Update the git_status of the directory
@@ -272,7 +273,7 @@ end
272273
---Create a sanitized partial copy of a node, populating children recursively.
273274
---@return DirectoryNode cloned
274275
function DirectoryNode:clone()
275-
local clone = Node.clone(self) --[[@as DirectoryNode]]
276+
local clone = self.super.clone(self) --[[@as DirectoryNode]]
276277

277278
clone.has_children = self.has_children
278279
clone.group_next = nil

lua/nvim-tree/node/file-link.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function FileLinkNode:new(args)
2121
end
2222

2323
function FileLinkNode:destroy()
24-
FileNode.destroy(self)
24+
self.super.destroy(self)
2525
end
2626

2727
---Update the git_status of the target otherwise the link itself
@@ -60,7 +60,7 @@ end
6060
---Create a sanitized partial copy of a node
6161
---@return FileLinkNode cloned
6262
function FileLinkNode:clone()
63-
local clone = FileNode.clone(self) --[[@as FileLinkNode]]
63+
local clone = self.super.clone(self) --[[@as FileLinkNode]]
6464

6565
clone.link_to = self.link_to
6666
clone.fs_stat_target = self.fs_stat_target

lua/nvim-tree/node/file.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function FileNode:new(args)
3131
end
3232

3333
function FileNode:destroy()
34-
Node.destroy(self)
34+
self.super.destroy(self)
3535
end
3636

3737
---Update the GitStatus of the file
@@ -96,7 +96,7 @@ end
9696
---Create a sanitized partial copy of a node
9797
---@return FileNode cloned
9898
function FileNode:clone()
99-
local clone = Node.clone(self) --[[@as FileNode]]
99+
local clone = self.super.clone(self) --[[@as FileNode]]
100100

101101
clone.extension = self.extension
102102

lua/nvim-tree/node/root.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function RootNode:is_dotfile()
1919
end
2020

2121
function RootNode:destroy()
22-
DirectoryNode.destroy(self)
22+
self.super.destroy(self)
2323
end
2424

2525
return RootNode

lua/nvim-tree/renderer/decorator/init.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ local Class = require("nvim-tree.classic")
44
---@alias DecoratorIconPlacement "none" | "before" | "after" | "signcolumn" | "right_align"
55

66
---Abstract Decorator
7-
---Uses the factory pattern to instantiate child instances.
87
---@class (exact) Decorator: Class
98
---@field protected explorer Explorer
109
---@field protected enabled boolean

0 commit comments

Comments
 (0)