Repository navigation
Fix split-view highlight desync (#71) - #94
Merged
Merged
Conversation
When the same document was open in multiple split panes, editing one pane only re-highlighted the active editor, leaving the other pane's trailing-space decorations stale (missing highlights, or a leftover red sliver after a deletion). Re-highlight every visible editor showing the changed document instead of just the active one. Add regression tests covering split view for both trim-on-save and highlight sync. Decorations cannot be read back through the VSCode API, so TrailingSpaces retains the ranges it applies per editor and exposes a narrow getHighlightedRanges fetcher. The integration test hooks (settings + getHighlightedRanges) are returned from activate() only outside production (gated on extensionMode), so no internal objects are handed out on the production API surface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shardulm94
force-pushed
the
fix/split-view-highlight-desync-71
branch
from
June 20, 2026 21:37
20b641d to
6162e0e
Compare
Merged
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
Fixes the highlight half of #71. When the same file is open in multiple split panes, editing one pane only re-highlighted the active editor, leaving the other pane's trailing-space decorations stale:
Root cause:
onDidChangeTextDocumentonly calledhighlight()onwindow.activeTextEditor. Decorations are per-TextEditor, so the other visible editor for the same document was never refreshed. The fix re-highlights every visible editor showing the changed document.Tests
Two new split-view regression tests (
issue71.test.ts,issue71-highlight.test.ts), both verified to fail without the corresponding fix and pass with it. Full suite: 15 passing.Decorations can't be read back through the VS Code API, so
TrailingSpacesretains the ranges it applies per editor (WeakMap) and exposes a narrowgetHighlightedRangesfetcher. The integration-test hooks (settings+getHighlightedRanges) are returned fromactivate()only outside production (gated onextensionMode), so no internal objects are exposed on the production API surface.🤖 Generated with Claude Code