Repository navigation
Reload the document from disk on demand (⌘R) - #37
Merged
Merged
Conversation
Auto-reload relies on file-system events, which some network volumes and
editors' save strategies never deliver; the only way back to the current
text was closing and reopening the document. View ▸ Reload (⌘R) and a ↻ pill
in the top-right cluster re-read the file now and restart the watcher, so a
watcher that lost track of the file recovers too.
A toast says whether anything changed ("Reloaded" / "Reloaded · no
changes"); a missing file shows the existing "File no longer exists" banner.
Disabled while Source Edit shows: the session already follows the disk and
owns the conflict banner, so a second path to the same file would race it.
Routed through @focusedvalue like every other per-document command, so ⌘R
acts on the frontmost tab only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thank you, @rinh - merged. Reload on demand is a good fit, and the pill stays. A follow-up commit (77c98cf) handles three edge cases found in review and checked on a build:
Thanks also for flagging the TextEdit test under a Chinese locale. It now checks the English name only when English is the first preferred language (7c325f5). This goes out in the next release. |
Owner
|
Shipped in v1.13.0: https://github.com/b451c/quickmd/releases/tag/v1.13.0 (also on Homebrew). Thanks again, @rinh! |
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
A manual Reload for the rendered view: View ▸ Reload (⌘R) and a ↻ pill in the top-right cluster, next to Edit.
Why
Auto-reload depends on file-system events. Some network volumes and some editors' save strategies never deliver them. When that happens, the only way to see the current text today is to close the document and open it again.
How
reloadManually()inMarkdownViewreusesreloadFromDisk()(same decoding and line-ending normalization as the first load), then callsstartWatching(url)again so a watcher that lost track of the file starts working again.@FocusedValue(reloadDocumentAction) like the other per-document commands, so ⌘R acts on the frontmost tab only. ⌘R was unused (⌘⇧R is Reading Mode).[Unreleased]) and the README's "Works with Your Editor" section have a line each.Testing
xcodebuild … test: everything passes exceptExternalEditorLineTests.testAppDisplayNameHasNoAppExtension. That test also fails onmainon a Mac set to Chinese, because TextEdit's localized display name is "文本编辑". It is unrelated to this change and passes under an English locale such as CI.-DAPPSTOREbuild: both succeed.🤖 Generated with Claude Code