Skip to content

Commit 5aea597

Browse files
committed
Rename buffer_severity_dict to BUFFER_SEVERITY
Signed-off-by: iusmac <[email protected]>
1 parent bc4a26d commit 5aea597

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lua/nvim-tree/diagnostics.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ local severity_levels = {
1111
Hint = 4,
1212
}
1313

14-
--- A dictionary tree containing buffer-severity mappings.
14+
--- The buffer-severity mappings derived during the last diagnostic list update.
1515
---@type table
16-
local buffer_severity_dict = {}
16+
local BUFFER_SEVERITY = {}
1717

1818
--- The cache version number of the buffer-severity mappings.
1919
---@type integer
@@ -91,12 +91,12 @@ function M.update()
9191
utils.debounce("diagnostics", M.debounce_delay, function()
9292
local profile = log.profile_start "diagnostics update"
9393
if is_using_coc() then
94-
buffer_severity_dict = from_coc()
94+
BUFFER_SEVERITY = from_coc()
9595
else
96-
buffer_severity_dict = from_nvim_lsp()
96+
BUFFER_SEVERITY = from_nvim_lsp()
9797
end
9898
BUFFER_SEVERITY_VERSION = BUFFER_SEVERITY_VERSION + 1
99-
log.node("diagnostics", buffer_severity_dict, "update")
99+
log.node("diagnostics", BUFFER_SEVERITY, "update")
100100
log.profile_end(profile)
101101
if view.is_buf_valid(view.get_bufnr()) then
102102
require("nvim-tree.renderer").draw()
@@ -116,7 +116,7 @@ function M.update_node_severity_level(node)
116116
if is_folder then
117117
local max_severity = nil
118118
if M.show_on_dirs and (not node.open or M.show_on_open_dirs) then
119-
for bufname, severity in pairs(buffer_severity_dict) do
119+
for bufname, severity in pairs(BUFFER_SEVERITY) do
120120
local node_contains_buf = vim.startswith(bufname, nodepath .. "/")
121121
if node_contains_buf then
122122
if severity == M.severity.max then
@@ -130,7 +130,7 @@ function M.update_node_severity_level(node)
130130
end
131131
node.diag_status = max_severity
132132
else
133-
node.diag_status = buffer_severity_dict[nodepath]
133+
node.diag_status = BUFFER_SEVERITY[nodepath]
134134
end
135135
node.diag_status_version = BUFFER_SEVERITY_VERSION
136136
end

0 commit comments

Comments
 (0)