Repository navigation
fix: skip virtual text for a list that changed after rendering - #78
Open
charliie-dev wants to merge 1 commit into
Open
charliie-dev wants to merge 1 commit into
charliie-dev wants to merge 1 commit into
Conversation
The virtual text is added from a scheduled callback that only checked the line count. When a one-item list was emptied before it ran, the leftover empty line passed that check and placing the extmark failed with "Invalid 'col': out of range". Leave the buffer alone when its lines no longer match what was rendered; a newer render schedules its own update.
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.
Summary
set_virt_textruns fromvim.scheduleand only checks the line count before placing extmarks. If a one-item list is emptied before it runs, the empty line left in the quickfix buffer passes that check, and the extmark goes to a column the line doesn't have:quickfixtextfunc(info) render lines (ret) and their virtual text (locations) vim.schedule(set_virt_text) set_virt_text() if line count < end_idx: retry later + if the lines no longer match what was rendered: return clear namespaces place extmarks at each line's EM_QUAD columnWhen the lines no longer match, the buffer shows something else now, and whatever re-rendered it schedules its own
set_virt_text.Evidence
Before: the new test in
display_spec.luafails:After: it passes, and
./run_tests.shpasses in full (fs 2, opts 2, whitespace 3, context 4, display 5, editor 13).A script that loads only quicker.nvim, with a fresh quickfix buffer per case:
:copen:copenOne earlier full run with this change failed
display sets signs for diagnosticsonce. It passed in every run after that: four with this change and two without.Merge Danger
Door: two-way
Blast Radius: small
It only returns early when the buffer lines differ from the lines this render produced. If they differ for another reason before the callback runs (for example the list is edited in the same tick), that render's virtual text is skipped until the next render.