lwblackledge / file-watcher

An open file watcher for Atom that will prompt when the file on disk has changed.
MIT License
34 stars 7 forks source link

Notifies me of changes even when I've closed the file #18

Closed its-dlh closed 7 years ago

its-dlh commented 7 years ago

I'm on SSHFS on Linux, so I started using the WatchFile option. That option works great and I'm now getting notified when I wasn't before, but the only problem is, if I've had a file open previously and then closed its tab, I'll still get notifications for that file even after it's closed. I thought it could be related to the Prompt on Change option, but I want to keep that option on for files that I still have open.

its-dlh commented 7 years ago

Any ideas on this? It's very annoying.

its-dlh commented 7 years ago

I've fixed the issue locally by changing line 128 of file-watcher.coffee to

(fs.unwatchFile @currPath) if @useFsWatchFile

lwblackledge commented 7 years ago

Sorry about the delay on this. Yeah I am probably not removing that new watch, and it looks like you found that issue. My bad. I'll make this fix as soon as possible.

lwblackledge commented 7 years ago

Thanks, I added that check to the destroy. Please let me know if it does not solve the problem.

its-dlh commented 7 years ago

Thanks, although my solution was off, because it was throwing errors if I closed a tab where there wasn't an underlying file. I don't really know Coffeescript, but I think the real issue was that hasUnderlyingFile was locally scoped instead of being a property of the object, so I undid my earlier "fix" and just changed every instance of hasUnderlyingFile to @hasUnderlyingFile.

lwblackledge commented 7 years ago

Thanks. It did cause #21. And again, I'll use your fix for the next release.

lwblackledge commented 7 years ago

Fixed in b072936