replace enums with named maps
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
local buffers = require("nvim-tree.buffers")
|
||||
|
||||
local HL_POSITION = require("nvim-tree.enum").HL_POSITION
|
||||
local ICON_PLACEMENT = require("nvim-tree.enum").ICON_PLACEMENT
|
||||
|
||||
local Decorator = require("nvim-tree.renderer.decorator")
|
||||
|
||||
---@class (exact) DecoratorOpened: Decorator
|
||||
@@ -18,8 +15,8 @@ function DecoratorOpened:new(args)
|
||||
Decorator.new(self, {
|
||||
explorer = args.explorer,
|
||||
enabled = true,
|
||||
hl_pos = HL_POSITION[args.explorer.opts.renderer.highlight_opened_files] or HL_POSITION.none,
|
||||
icon_placement = ICON_PLACEMENT.none,
|
||||
hl_pos = args.explorer.opts.renderer.highlight_opened_files or "none",
|
||||
icon_placement = "none",
|
||||
})
|
||||
end
|
||||
|
||||
@@ -27,7 +24,7 @@ end
|
||||
---@param node Node
|
||||
---@return string|nil group
|
||||
function DecoratorOpened:calculate_highlight(node)
|
||||
if self.hl_pos ~= HL_POSITION.none and buffers.is_opened(node) then
|
||||
if self.range ~= "none" and buffers.is_opened(node) then
|
||||
return "NvimTreeOpenedHL"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user