Skip to content

Clear editor highlighting on reload#415

Merged
schuyler merged 1 commit into
schuyler:mainfrom
yusufm:Codex/clear-highlighting-on-reload-019def52-b3da-7962-96cd-afa05d8d1592
Jun 22, 2026
Merged

Clear editor highlighting on reload#415
schuyler merged 1 commit into
schuyler:mainfrom
yusufm:Codex/clear-highlighting-on-reload-019def52-b3da-7962-96cd-afa05d8d1592

Conversation

@yusufm

@yusufm yusufm commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • clear existing editor highlighting after replacing text during reload from disk
  • refresh clear-text attributes before scheduling the new highlight pass
  • add a lifecycle regression for the external reload path

Related to #378.

Validation

  • xcodebuild test -workspace 'MacDown 3000.xcworkspace' -scheme MacDown -destination 'platform=macOS' -only-testing:MacDownTests/MPDocumentLifecycleTests/testExistingDocumentClearsHighlightingBeforeReloadHighlight -only-testing:MacDownTests/MPDocumentLifecycleTests/testExistingDocumentTriggersRenderOnReload -only-testing:MacDownTests/MPDocumentLifecycleTests/testExistingDocumentTriggersHighlightOnReload

Note: the last only-testing selector is not present on main, so Xcode ran the two matching lifecycle tests.

@yusufm yusufm marked this pull request as ready for review May 3, 2026 20:35

@schuyler schuyler left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great — thanks @yusufm. The clearHighlightingreadClearTextStylesFromTextViewparseAndHighlightNow sequence correctly mirrors the highlighter's own ordering in applyStylesFromStylesheet:, and since parseAndHighlightNow only schedules an async parse, the explicit synchronous clear is what actually closes the stale-attribute gap from #378. Nice regression test too. Approving.


Generated by Claude Code

@schuyler schuyler merged commit 5773eb8 into schuyler:main Jun 22, 2026
5 checks passed
@schuyler schuyler added the rc-pending Included in a release candidate awaiting validation label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rc-pending Included in a release candidate awaiting validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants