File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
lua/nvim-tree/renderer/decorator Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 1+ local diagnostics = require " nvim-tree.diagnostics"
2+
13local HL_POSITION = require (" nvim-tree.enum" ).HL_POSITION
24local ICON_PLACEMENT = require (" nvim-tree.enum" ).ICON_PLACEMENT
35
6769--- @return HighlightedString[] | nil icons
6870function DecoratorDiagnostics :calculate_icons (node )
6971 if node and self .enabled and self .icons then
70- if node .diag_status then
71- return { self .icons [node .diag_status ] }
72+ local diag_status = diagnostics .get_diag_status (node )
73+ local diag_value = diag_status and diag_status .value
74+
75+ if diag_value then
76+ return { self .icons [diag_value ] }
7277 end
7378 end
7479end
@@ -81,11 +86,18 @@ function DecoratorDiagnostics:calculate_highlight(node)
8186 return nil
8287 end
8388
89+ local diag_status = diagnostics .get_diag_status (node )
90+ local diag_value = diag_status and diag_status .value
91+
92+ if not diag_value then
93+ return nil
94+ end
95+
8496 local group
8597 if node .nodes then
86- group = HG_FOLDER [node . diag_status ]
98+ group = HG_FOLDER [diag_value ]
8799 else
88- group = HG_FILE [node . diag_status ]
100+ group = HG_FILE [diag_value ]
89101 end
90102
91103 if group then
You can’t perform that action at this time.
0 commit comments