-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload document on application:openFile: #576
Comments
+1. Running external tools to modify the file (e.g., doctoc) it would be useful if the source window would update on changes, or if there was a way to "reload" the source without opening and closing the document. |
I tried these steps but didn't reproduce the issue:
I saw an updated |
Yep, step 2: IIUTC you should not close the document from MacDown. If the file is edited with another editor and then saved while still open in MacDown, then the document should be reloaded in MacDown (so that the changes from the other editor are loaded). |
The best logic for this is:
|
Would this work? I thought this is called only when you open a file. It would be the way to go if this is also called when an open document becomes active. Note: I did try using |
I've used VDKQueue for this kind of thing in my own projects. |
Then this is a duplicate of #48. How does |
Yes @uranusjr mentioned VDKQueue in #564 (comment). |
applicationShouldHandleReopen is what I had in mind initially: But VDKQueue is the way to go. That way, the file is automatically updated without MacDown needing an apple event to trigger it. |
The problem about VDKQueue is I can’t find any documentation nor discussion about it. And I make sure it does not have any quirks before using it. |
I've used it in my projects for years without trouble, but YMMV. |
It seems like Transmission also uses it… I guess that’s good enough. |
Note that
according to bdkjones/VDKQueue#8. We can use the fork that fixed that; I scanned the network and this fork seems to merged everything (which also brings risks of course). |
Doesn't Is there a bug in this implementation? Not sure why we need |
I often use MacDown to view Markdown documents that I edit using XCode, by selecting "Open with External Editor" from within XCode. However, the Markdown document is not reloaded when reopened with Macdown.
It would be great if Macdown reloaded the Markdown document when it receives an application:openFile: event. Just a suggestion from a casual user.
The text was updated successfully, but these errors were encountered: