mjdescy / TodoTxtMac

TodoTxtMac is a minimalist, keyboard-driven to-do manager for Mac OS X (10.8 Mountain Lion and higher) that conforms to the todo.txt format spec.
Other
242 stars 40 forks source link

Reload marks the file as modified #85

Closed pib closed 8 years ago

pib commented 9 years ago

Whenever I use the reload command (from the menu or the . key), the titlebar of the window adds "-- Edited". When the file has actually changed on disk, it complains about how it can't save because the file has been edited on disk and asks if I want to save anyway or revert.

I'm assuming this isn't how it is supposed to behave.

Also, it would be nice if it could just watch the file on disk and auto-reload whenever the file has changed (assuming no edits have been done first).

mjdescy commented 9 years ago

Hi, @pib. I know that's not optimal behavior, but it is expected behavior at this time. TodoTxtMac is NSDocument based, and it inherits that behavior from the NSDocument base class. It actually does automatically refresh when the file is changed on disk by other NSDocument-based apps (TextEdit is the #1 example). That behavior isn't as useful as automatically refreshing whenever the file is changed, but at least it is a start.

Issue #19 is an enhancement request for auto-reload when the file changes. I had trouble implementing that a while back, and it has been back-burnered ever since. The problem wasn't observing the file changing so much as not observing it changing all the time and triggering excessive reloads.

pib commented 9 years ago

Ah, ok. I'm using DropBox to sync the file at the moment, which is not going to be an NSDocument-based app :D

I can deal with hitting "." and then hitting "⌘S" to save for the time being.