-
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
Always display latest version of file #564
Conversation
I like this behavior. Well done! |
wait for this feature for long time,thank you~! |
I'm using MacDown 0.6 on El Capitan, but this doesn't seem to work for me. I'm using MacVim, to create a file at Do I need to do anything special to enable this feature? What am I doing wrong? Or did I totally misunderstand the nature of the feature/fix? |
El Capitan 10.11.5, MacDown 0.6 (749) The setup: one file opened in MacDown and BBEdit - works OK. If I change the file in MacDown the changes appear in BBEdit and vice versa. But! The file is in the Dropbox folder. And when I change the file on my iPad (no matter in what program) and Dropbox syncs the changes on my Mac MacDown won't reflect the changes. While BBEdit does reflect them. So MacDown fails in this case. |
This also doesn't work for me. Following the same steps as @kohanyirobert, I get the same behaviour. I was expecting to change the file in vim, then return focus to MacDown and see my change appear with no further input. For me this problem is manifesting mostly when I switch branches in git - I have to remember to close and re-open the file in MacDown, which is frustrating. MacDown 0.6 (749) and Yosemite 10.10.5. |
Also doesn't work for me with same setup as Harry (MacDown 0.6 (749) and Yosemite 10.10.5). In my case I am regenerating the file that I had open in MacDown. When I got back to MacDown it is stuck on the old version. Great feature though, and will genuinely be a gamechanger for me if you can get it working! |
Maybe we should just use low-level API to listen to file change notifications and update explicitly. Does anyone know of a good framework for this? |
I just asked Google and it gave me two: File System Events and Kernel Queues, but both documentations suggest that Kernel Queues are more appropriate for monitoring a single file. Its manual page is here. |
TeXShop does this and might be a good reference. Looks to me that they use something in the GCD family but I'm not good enough to understand it. |
@es2mac I scanned the source. It seems to be related to Dispatch Sources about which I never knew, but it seems promising. |
@FranklinYu @es2mac I knew about File System Events, but do not want to use it because it is just too tedious and complex. Kqueue looks much better. I also found VDKQueue which seems to be a nice Objective-C wrapper. Dispatch Sources looks even simpler, but I haven’t found much discussion around it. I think I will go with Dispatch Sources for now, but also build a wrapper around it so that we can switch camp if needed. Thanks for the pointer! |
OK so I tried to implement this in a seperate branch. You can follow the referral link above to see the change, and a link to a test build. Please give it a try and tell me what you think. Thanks! |
Hi. Are there plans to fix MacDown's auto-reload of files on OSX? Thank you for the great work by the way. |
ping on this? still not working on OSX; when editing file in sublimetext, change is not reflected in macdown |
@timotheecour this PR was merged already. Please create a new issue or comment on an open issue if you’re still having issues with the latest version |
For reference, there is already another issue open. It's #630 |
This PR closes #559, closes #529, closes #349, closes #351, and closes #48. All of these issues are approximately duplicates of the same issue, which is that files modified by other applications aren't reflected in MacDown.
These changes are automatically passed to
[NSDocument -readFromData:ofType:error:]
. All this change does is update the display with the changes, rather than ignore them, which is what's happening now.Here's how it looks with the new behavior:
As a reminder, here's the old behavior, in which MacDown overwrites external changes without warning: