Current state
lua/config/plugins/specs/nvim-lint.lua registers lint.try_lint() on both BufEnter and BufWritePost. BufEnter fires every time the user switches to any buffer — including switching windows, opening help pages, and navigating the file tree — causing a full lint process to spawn on each transition regardless of whether the buffer's content has changed.
Ideal state
- Linting is triggered only on
BufWritePost (and optionally InsertLeave for a real-time feel after leaving insert mode).
BufEnter is removed from the autocmd event list.
- No lint processes are spawned when the user switches windows or opens a non-editable buffer.
Starting points
lua/config/plugins/specs/nvim-lint.lua — the autocmd registration listing BufEnter alongside BufWritePost
QA plan
- Open
lua/config/plugins/specs/nvim-lint.lua. Expect to see BufEnter in the autocmd event list passed to nvim_create_autocmd.
- After the fix, read the file. Expect
BufEnter to be absent; BufWritePost (and optionally InsertLeave) remain.
- Start Neovim, open a linted file, and switch to another window. Expect no linter process to be spawned (observable via
:lua print(vim.inspect(require('lint').get_running())) returning an empty table immediately after the switch).
- Save the linted file. Expect
lint.try_lint() to run and diagnostics to appear normally.
Done when
lint.try_lint() is not invoked when the user switches buffers or windows — only after a file save (and optionally after leaving insert mode).
Current state
lua/config/plugins/specs/nvim-lint.luaregisterslint.try_lint()on bothBufEnterandBufWritePost.BufEnterfires every time the user switches to any buffer — including switching windows, opening help pages, and navigating the file tree — causing a full lint process to spawn on each transition regardless of whether the buffer's content has changed.Ideal state
BufWritePost(and optionallyInsertLeavefor a real-time feel after leaving insert mode).BufEnteris removed from the autocmd event list.Starting points
lua/config/plugins/specs/nvim-lint.lua— the autocmd registration listingBufEnteralongsideBufWritePostQA plan
lua/config/plugins/specs/nvim-lint.lua. Expect to seeBufEnterin the autocmd event list passed tonvim_create_autocmd.BufEnterto be absent;BufWritePost(and optionallyInsertLeave) remain.:lua print(vim.inspect(require('lint').get_running()))returning an empty table immediately after the switch).lint.try_lint()to run and diagnostics to appear normally.Done when
lint.try_lint()is not invoked when the user switches buffers or windows — only after a file save (and optionally after leaving insert mode).