Skip to content

Commit

Permalink
fix: work with older version of Neovim
Browse files Browse the repository at this point in the history
  • Loading branch information
delphinus committed Dec 3, 2024
1 parent 69f45ea commit 9b9c743
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/ale/diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ module.sendAleResultsToDiagnostics = function(buffer, loclist)
if set_signs == 1 and sign_priority then
-- If signs are enabled, set the priority for them.
local local_cfg = { priority = sign_priority }
local global_cfg = vim.diagnostic.config().signs
-- NOTE: vim.diagnostic.config() -- retrieving the current config values
-- fails in Neovim older than v0.7.0.
local ok, diag_cfg = pcall(vim.diagnostic.config)
if not ok or not diag_cfg then
diag_cfg = { signs = {} }
end
local global_cfg = diag_cfg.signs

if type(global_cfg) == 'boolean' then
signs = local_cfg
Expand Down

0 comments on commit 9b9c743

Please sign in to comment.