[audit] fix: wrap statusline autocmds in an augroup - #323
Draft
stanfish06 wants to merge 1 commit into
Draft
Conversation
ColorScheme (x2) and LspProgress were registered with no augroup, unlike every other config module in this repo. Re-sourcing statusline.lua (a supported workflow per this repo's own dev notes) stacks a second LspProgress autocmd whose closure owns its own lsp_progress table and its own vim.uv timer; the stale timer is never cleaned up and keeps firing redrawstatus every 100ms, the same orphaned-timer failure mode already fixed for tabline_timer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wraps the three autocmds in
lua/config/statusline.lua(twoColorSchemehandlers and theLspProgresshandler) in a singlenvim_create_augroup("Statusline", { clear = true }), mirroring the pattern already used inorgview.lua,scopeline.lua,treesitter.lua, and thetabline_timerfix inoptions.lua.Where
lua/config/statusline.lua:4,:106,:217(pre-change line numbers).Why it matters
None of these three autocmds were registered under an augroup. This repo's own dev notes (
init.luacomments, and thetabline_timerhandling inoptions.lua) treat:source %on individual config files as a normal iterative-dev workflow, and other modules already guard against the fallout withclear = trueaugroups.Without a group, re-sourcing
statusline.luastacks a secondLspProgressautocmd. That new closure owns its ownlsp_progresstable and its ownvim.uv.new_timer()(line 84), but the globalStatusLine()/current_lsp_progress()functions get overwritten by the re-source, so nothing ever reads the old closure's table again — its timer is orphaned exactly like the previously-fixedtabline_timerleak, and keeps firingredrawstatusevery 100ms for as long as the stale closure keeps seeing LSP progress events.Fix
Create one
augrouplocal and passgroup = augroupto all threenvim_create_autocmdcalls. No behavior change on a fresh (non-resourced) start; only affects the re-source workflow.Generated by Claude Code