issue #101 disable diagnostic_scrollbar

neovim_0.6
ray-x 3 years ago
parent 19df02d40d
commit 388711d97d

@ -265,7 +265,7 @@ require'navigator'.setup({
-- to disable all default config and use your own lsp setup set
-- disable_lsp = 'all'
-- Default {}
diagnostic_scroll_bar_sign = {'▃', '▆', '█'}, -- experimental: diagnostic status in scroll bar area; set to nil to disable the diagnostic sign,
diagnostic_scrollbar_sign = {'▃', '▆', '█'}, -- experimental: diagnostic status in scroll bar area; set to false to disable the diagnostic sign,
-- for other style, set to {'╍', 'ﮆ'} or {'-', '='}
diagnostic_virtual_text = true, -- show virtual for diagnostic message
diagnostic_update_in_insert = false, -- update diagnostic message in insert mode

@ -135,8 +135,12 @@ local extend_config = function(opts)
for k, v in pairs(value) do
-- level 3
if type(_NgConfigValues[key][k]) == "table" then
for k2, v2 in pairs(v) do
_NgConfigValues[key][k][k2] = v2
if type(v) == "table" then
for k2, v2 in pairs(v) do
_NgConfigValues[key][k][k2] = v2
end
else
_NgConfigValues[key][k] = v
end
else
_NgConfigValues[key][k] = v

@ -42,13 +42,15 @@ local function get_count(bufnr, level)
end
local function error_marker(result, ctx, config)
if _NgConfigValues.lsp.diagnostic_scrollbar_sign == nil or _NgConfigValues.lsp.diagnostic_scrollbar_sign == {}
or _NgConfigValues.lsp.diagnostic_scrollbar_sign == false then -- not enabled or already shown
return
end
vim.defer_fn(function()
if vim.tbl_isempty(result.diagnostics) then
return
end
if _NgConfigValues.lsp.diagnostic_scrollbar_sign == nil then -- not enabled or already shown
return
end
local first_line = vim.fn.line('w0')
-- local rootfolder = vim.fn.expand('%:h:t') -- get the current file root folder
@ -170,7 +172,7 @@ end
local update_err_marker_async = function()
local debounce = require'navigator.debounce'.debounce_trailing
return debounce(20, error_marker)
return debounce(200, error_marker)
end
local diag_hdlr = mk_handler(function(err, result, ctx, config)

Loading…
Cancel
Save