File tree 3 files changed +7
-3
lines changed
lua/nvim-tree/renderer/decorator
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ local HL_POSITION = require("nvim-tree.enum").HL_POSITION
4
4
local ICON_PLACEMENT = require (" nvim-tree.enum" ).ICON_PLACEMENT
5
5
6
6
local Decorator = require (" nvim-tree.renderer.decorator" )
7
+ local DirectoryNode = require (" nvim-tree.node.directory" )
7
8
8
9
-- highlight groups by severity
9
10
local HG_ICON = {
@@ -98,7 +99,7 @@ function DecoratorDiagnostics:calculate_highlight(node)
98
99
end
99
100
100
101
local group
101
- if node . nodes then
102
+ if node : is ( DirectoryNode ) then
102
103
group = HG_FOLDER [diag_value ]
103
104
else
104
105
group = HG_FILE [diag_value ]
Original file line number Diff line number Diff line change 1
1
local HL_POSITION = require (" nvim-tree.enum" ).HL_POSITION
2
2
local ICON_PLACEMENT = require (" nvim-tree.enum" ).ICON_PLACEMENT
3
+
3
4
local Decorator = require (" nvim-tree.renderer.decorator" )
5
+ local DirectoryNode = require (" nvim-tree.node.directory" )
4
6
5
7
--- @class (exact ) DecoratorHidden : Decorator
6
8
--- @field icon HighlightedString ?
@@ -48,7 +50,7 @@ function DecoratorHidden:calculate_highlight(node)
48
50
return nil
49
51
end
50
52
51
- if node . nodes then
53
+ if node : is ( DirectoryNode ) then
52
54
return " NvimTreeHiddenFolderHL"
53
55
else
54
56
return " NvimTreeHiddenFileHL"
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ local HL_POSITION = require("nvim-tree.enum").HL_POSITION
4
4
local ICON_PLACEMENT = require (" nvim-tree.enum" ).ICON_PLACEMENT
5
5
6
6
local Decorator = require (" nvim-tree.renderer.decorator" )
7
+ local DirectoryNode = require (" nvim-tree.node.directory" )
7
8
8
9
--- @class (exact ) DecoratorModified : Decorator
9
10
--- @field icon HighlightedString | nil
@@ -55,7 +56,7 @@ function DecoratorModified:calculate_highlight(node)
55
56
return nil
56
57
end
57
58
58
- if node . nodes then
59
+ if node : is ( DirectoryNode ) then
59
60
return " NvimTreeModifiedFolderHL"
60
61
else
61
62
return " NvimTreeModifiedFileHL"
You can’t perform that action at this time.
0 commit comments