Skip to content

Commit ecb22c7

Browse files
committed
chore: resolve undefined-field
1 parent aba83cc commit ecb22c7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local HL_POSITION = require("nvim-tree.enum").HL_POSITION
44
local ICON_PLACEMENT = require("nvim-tree.enum").ICON_PLACEMENT
55

66
local Decorator = require("nvim-tree.renderer.decorator")
7+
local DirectoryNode = require("nvim-tree.node.directory")
78

89
-- highlight groups by severity
910
local HG_ICON = {
@@ -98,7 +99,7 @@ function DecoratorDiagnostics:calculate_highlight(node)
9899
end
99100

100101
local group
101-
if node.nodes then
102+
if node:is(DirectoryNode) then
102103
group = HG_FOLDER[diag_value]
103104
else
104105
group = HG_FILE[diag_value]

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
local HL_POSITION = require("nvim-tree.enum").HL_POSITION
22
local ICON_PLACEMENT = require("nvim-tree.enum").ICON_PLACEMENT
3+
34
local Decorator = require("nvim-tree.renderer.decorator")
5+
local DirectoryNode = require("nvim-tree.node.directory")
46

57
---@class (exact) DecoratorHidden: Decorator
68
---@field icon HighlightedString?
@@ -48,7 +50,7 @@ function DecoratorHidden:calculate_highlight(node)
4850
return nil
4951
end
5052

51-
if node.nodes then
53+
if node:is(DirectoryNode) then
5254
return "NvimTreeHiddenFolderHL"
5355
else
5456
return "NvimTreeHiddenFileHL"

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local HL_POSITION = require("nvim-tree.enum").HL_POSITION
44
local ICON_PLACEMENT = require("nvim-tree.enum").ICON_PLACEMENT
55

66
local Decorator = require("nvim-tree.renderer.decorator")
7+
local DirectoryNode = require("nvim-tree.node.directory")
78

89
---@class (exact) DecoratorModified: Decorator
910
---@field icon HighlightedString|nil
@@ -55,7 +56,7 @@ function DecoratorModified:calculate_highlight(node)
5556
return nil
5657
end
5758

58-
if node.nodes then
59+
if node:is(DirectoryNode) then
5960
return "NvimTreeModifiedFolderHL"
6061
else
6162
return "NvimTreeModifiedFileHL"

0 commit comments

Comments
 (0)