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

Add "Reload All" option #23

Open MartinBonner opened 7 years ago

MartinBonner commented 7 years ago

When I do git checkout master after working on my branch, I get 57(†) prompts to reload files. If I want to ignore them all, there is a nice big "Ignore All" button; but if I want to reload them all, there is no "Reload All".

† This may be hyperbole

This is intended to be a feature request.

lwblackledge commented 7 years ago

I think I need a clearer option for 'Ignore All'. It actually stops tracking that file into you open atom again. Maybe 'Ignore Future Changes'.

Anyway, for the checkout issue I can look into a reload all option but that would be a major change since the tracking is per file.

In the mean time can you try turning off the 'Prompt on Change' option which will use Atom's default behavior of auto-reloading if you do not have any unsaved changes.

MartinBonner commented 7 years ago

Ignore all: Eek! Yes. I hadn't realized that's what it did.

This is a cheezy hack, but how about "Reload all" (and presumably a new "ignore all") reloads or ignores all changes in the next ~100ms. It involves global state (eew!), and there's a race condition (double eew!), but it's probably good enough.

lwblackledge commented 7 years ago

Yes some sort of global state would be needed and I think that more changes would be required. This would be worth linking to #10 as well since the popup may have to be redesigned.

lwblackledge commented 7 years ago

Did you try disabling the Prompt on Change option?

hperrin commented 7 years ago

+1 I'd like this too. Maybe a "Auto reload for the next 5 seconds" or something.