macdown
macdown copied to clipboard
Auto-reload the file, or an option to refresh the currently open file
My use case is that I use MacDown for preview, but using another editor (ST3) for writing documentation/md file. So I switch between MacDown and ST. Now I pretty much need to close MacDown and reopen the same file again after making edit in ST.
Will be great if MacDown can detect the open file has changed and auto-reload, or simply having an option under File menu to refresh the file.
actually if you can give me some pointers on how to start, I will try to tackle this issue and make a PR. My first time developing for a mac app.
In My case, I have many markdown file in some kind of Database (DevonThink), and I can do quick edits there. But I prefer the much better look and even editing in MacDown. Still, sometimes I edit in DevonThink and then MacDown would not reload open files. And when I then edit the old version in MacDown, I would get this, when I try to save:
The document “...” could not be saved. The file has been changed by another application.
Save As / Revert / Save anyway (overwrite)
That feel like 1996 ;-)
@jimmychu0807, I think the workflow could be:
on Application activation (when it comes to the front), check for all open documents, if they were changed on disk. Then
- if there are no local unsaved edits, just reload without question
- if there are local unsaved changes, show the above error with the above options (+ perhaps "ignore", to handle the problem later on save, like it is now)
For Extra-points: ;-)
-
one could also check from time to time while in background, so that a live preview keeps updating when editing in some other app. ( But in this case do only (1); alerts as in (2) should only pop up when the app is the active one; just don't reload then, while in background)
-
one could provide an extra option "merge" or "combine" of local and remote changes
There might also be some macOS events, the app could subscribe to, so you won't have to actively look for changes every x seconds, but would be notified. I'm not sure.
I would love this feature as well. I edit with more advanced text editors like Atom, and do the rendering on MacDown. I like MacDown because of the rendering, it allows me to click on custom links unlike in Atom. There is always a danger of data loss when I have a document open in MacDown and I'm editing the same document on another app.
I edit in vim, but preview in macDown, this feature can really assist my workflow.