chore: class new is now generic

This commit is contained in:
Alexander Courtis
2024-10-28 14:00:52 +11:00
parent 5647bc3c7c
commit 9b365279df
18 changed files with 26 additions and 24 deletions

View File

@@ -19,7 +19,7 @@ function DecoratorBookmarks:create(opts, explorer)
hl_pos = HL_POSITION[opts.renderer.highlight_bookmarks] or HL_POSITION.none,
icon_placement = ICON_PLACEMENT[opts.renderer.icons.bookmarks_placement] or ICON_PLACEMENT.none,
}
o = self:new(o) --[[@as DecoratorBookmarks]]
o = self:new(o)
if opts.renderer.icons.show.bookmarks then
o.icon = {

View File

@@ -19,7 +19,7 @@ function DecoratorCopied:create(opts, explorer)
hl_pos = HL_POSITION[opts.renderer.highlight_clipboard] or HL_POSITION.none,
icon_placement = ICON_PLACEMENT.none,
}
o = self:new(o) --[[@as DecoratorCopied]]
o = self:new(o)
return o
end

View File

@@ -18,7 +18,7 @@ function DecoratorCut:create(opts, explorer)
hl_pos = HL_POSITION[opts.renderer.highlight_clipboard] or HL_POSITION.none,
icon_placement = ICON_PLACEMENT.none,
}
o = self:new(o) --[[@as DecoratorCut]]
o = self:new(o)
return o
end

View File

@@ -49,7 +49,7 @@ function DecoratorDiagnostics:create(opts, explorer)
hl_pos = HL_POSITION[opts.renderer.highlight_diagnostics] or HL_POSITION.none,
icon_placement = ICON_PLACEMENT[opts.renderer.icons.diagnostics_placement] or ICON_PLACEMENT.none,
}
o = self:new(o) --[[@as DecoratorDiagnostics]]
o = self:new(o)
if not o.enabled then
return o

View File

@@ -34,7 +34,7 @@ function DecoratorGit:create(opts, explorer)
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]]
o = self:new(o)
if not o.enabled then
return o

View File

@@ -20,7 +20,7 @@ function DecoratorHidden:create(opts, explorer)
hl_pos = HL_POSITION[opts.renderer.highlight_hidden] or HL_POSITION.none,
icon_placement = ICON_PLACEMENT[opts.renderer.icons.hidden_placement] or ICON_PLACEMENT.none,
}
o = self:new(o) --[[@as DecoratorHidden]]
o = self:new(o)
if opts.renderer.icons.show.hidden then
o.icon = {

View File

@@ -22,7 +22,7 @@ function DecoratorModified:create(opts, explorer)
hl_pos = HL_POSITION[opts.renderer.highlight_modified] or HL_POSITION.none,
icon_placement = ICON_PLACEMENT[opts.renderer.icons.modified_placement] or ICON_PLACEMENT.none,
}
o = self:new(o) --[[@as DecoratorModified]]
o = self:new(o)
if not o.enabled then
return o

View File

@@ -21,7 +21,7 @@ function DecoratorOpened:create(opts, explorer)
hl_pos = HL_POSITION[opts.renderer.highlight_opened_files] or HL_POSITION.none,
icon_placement = ICON_PLACEMENT.none,
}
o = self:new(o) --[[@as DecoratorOpened]]
o = self:new(o)
return o
end