File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
lua/neominimap/map/handlers/builtins Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -62,14 +62,17 @@ local icon_list = {
6262M .on_diagnostic_changed = function (apply , args )
6363 local logger = require (" neominimap.logger" )
6464 logger .log .trace (" DiagnosticChanged event triggered." )
65+ local bufnr = tonumber (args .buf )
66+ if not bufnr or not vim .api .nvim_buf_is_valid (bufnr ) then
67+ return
68+ end
69+ local diagnostics = args .data .diagnostics
70+ if config .diagnostic .use_event_diagnostics then
71+ local var = require (" neominimap.variables" )
72+ var .b [tonumber (bufnr )].diagnostics = diagnostics
73+ end
6574 vim .schedule (function ()
6675 logger .log .trace (" Updating diagnostics." )
67- local bufnr = args .buf
68- local diagnostics = args .data .diagnostics
69- if config .diagnostic .use_event_diagnostics then
70- local var = require (" neominimap.variables" )
71- var .b [bufnr ].diagnostics = diagnostics
72- end
7376 apply (bufnr )
7477 logger .log .trace (" Diagnostics updated." )
7578 end )
You can’t perform that action at this time.
0 commit comments