This repository was archived by the owner on Jul 6, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,18 +63,20 @@ function M.refresh_diagnostics()
6363 M .publish_diagnostics (bufnr )
6464end
6565
66+ function M .on_InsertLeave ()
67+ M .refresh_diagnostics ()
68+ end
69+
6670M .on_attach = function (_ , _ )
6771 -- Setup autocmd
6872 vim .api .nvim_command [[ augroup DiagnosticRefresh]]
69- vim .api .nvim_command [[ autocmd!]]
7073 vim .api .nvim_command [[ autocmd InsertLeave <buffer> lua require'jumpLoc'.initLocation()]]
71- vim .api .nvim_command [[ autocmd BufEnter ,TabEnter <buffer> lua require'diagnostic'.refresh_diagnostics()]]
74+ vim .api .nvim_command [[ autocmd BufWinEnter ,TabEnter <buffer> lua require'diagnostic'.refresh_diagnostics()]]
7275 vim .api .nvim_command [[ augroup end]]
7376
7477 if vim .api .nvim_get_var (' diagnostic_insert_delay' ) == 1 then
7578 vim .api .nvim_command [[ augroup DiagnosticInsertDelay]]
76- vim .api .nvim_command [[ autocmd!]]
77- vim .api .nvim_command [[ autocmd InsertLeave <buffer> lua require'diagnostic'.refresh_diagnostics()]]
79+ vim .api .nvim_command [[ autocmd InsertLeave <buffer> lua require'diagnostic'.on_InsertLeave()]]
7880 vim .api .nvim_command [[ augroup end]]
7981 end
8082end
You can’t perform that action at this time.
0 commit comments