Repository navigation
Fix code-block rendering, save integrity, and highlight restoration - #9
Merged
Merged
Conversation
added 7 commits
September 16, 2026 12:15
Capture the current mode before switching and invalidate stale callbacks. Regressions cover host commands, pending idle work, undo, and equation editing. Fixes #2.
Reuse the block serializer and retain code whitespace while excluding editor controls and rendered diagrams. Fixes #3.
Track up to three opening spaces and dedent content by that amount. Preserve tabs, deeper indentation, fence rules, and special blocks. Fixes #1.
Restore inactive regular blocks through the existing display transition because nested editable blocks share focus. Preserve active plain-text editing. Fixes #7.
Use the existing code text token without overriding syntax token colors or broadening the change to quote prose. Fixes #4.
Exercise the real source-mode keybinding, native save and reopen, fence rendering, focus restoration, and quoted-code colors in every native CI lane.
Document synthetic follow-up cases for #5 and the parser/serializer work requiring a separate reviewed change.
This was referenced Sep 16, 2026
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.
Code blocks could lose recent edits during source switching, turn into toolbar text when quoted content was saved, or render as prose when their fences were indented. This change preserves code through those paths and restores highlighting when another block becomes active.
Each fix has a separate commit and regression coverage. Production changes are confined to
src/webview/editor.jsand one CSS declaration. The fence change follows the CommonMark indentation rules; this is not a claim of full CommonMark compatibility.Validation:
npm test: 782 browser tests passed, including 44 new regression cases. Local unit suites had no failures; 11 converter-dependent checks were skipped locally.main(4d16748), whose validation passed, including the merged Windows browser-probe fixes.bd33079cbff656cdef44e354ad5c0ea83eb16883. Ubuntu, macOS, and Windows each passed all 782 browser tests with retries disabled. All four lanes, including VS Code 1.85.0, passed 237 unit/converter checks without skips and the installed-VSIX native flows, including all six code-block assertions.64f726b203bf9620c1dc56a4edc1227f6bcdd101(parents: currentmainand the branch head above). Its SHA-256 is209265bb72a8f6d19abeedb989d67f6e992e6ada908c895149431ba4eee79a67; the packaged editor JavaScript and CSS match the reviewed source byte for byte. This is a CI test merge, not a merge intomain.Issue #5 remains open: list continuation needs coordinated parser and serializer changes. The follow-up investigation records the remaining boundary, including wider numbered-list markers. Active code editing retains the existing plain-text behavior; #7 restores highlighting after leaving a block. General blockquote prose colors are outside #4's code-specific change.
Issue #11 also remains open. Native Save can omit a newer snapshot when an earlier queued host mutation overlaps save preparation. This was reproduced twice on the unmodified
mainVSIX using plain text, with an acknowledged-earlier-edit control passing. It requires a separate provider/save-queue change; this PR does not claim to fix that race.Closes #1.
Closes #2.
Closes #3.
Closes #4.
Closes #7.