chore: resolve undefined-field

This commit is contained in:
Alexander Courtis
2024-10-25 14:57:01 +11:00
parent e115199c5f
commit dd937d017f
3 changed files with 7 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ 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")
local DirectoryNode = require("nvim-tree.node.directory")
-- highlight groups by severity
local HG_ICON = {
@@ -98,7 +99,7 @@ function DecoratorDiagnostics:calculate_highlight(node)
end
local group
if node.nodes then
if node:is(DirectoryNode) then
group = HG_FOLDER[diag_value]
else
group = HG_FILE[diag_value]

View File

@@ -1,6 +1,8 @@
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")
local DirectoryNode = require("nvim-tree.node.directory")
---@class (exact) DecoratorHidden: Decorator
---@field icon HighlightedString?
@@ -48,7 +50,7 @@ function DecoratorHidden:calculate_highlight(node)
return nil
end
if node.nodes then
if node:is(DirectoryNode) then
return "NvimTreeHiddenFolderHL"
else
return "NvimTreeHiddenFileHL"

View File

@@ -4,6 +4,7 @@ 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")
local DirectoryNode = require("nvim-tree.node.directory")
---@class (exact) DecoratorModified: Decorator
---@field icon HighlightedString|nil
@@ -55,7 +56,7 @@ function DecoratorModified:calculate_highlight(node)
return nil
end
if node.nodes then
if node:is(DirectoryNode) then
return "NvimTreeModifiedFolderHL"
else
return "NvimTreeModifiedFileHL"