Git Product home page Git Product logo

Comments (5)

lwblackledge avatar lwblackledge commented on July 18, 2024

Thanks @DanielJoyce
Unfortunately what you are talking about is the default functionality in Atom.
The file-watcher package is triggered by the conflict state from Atom's internal file tracking, and that is not fired in the scenario you describe.

I did a quick check on editor behaviour:

Editor Behavior
Atom Automatically reloads
VS Code Automatically reloads
Notepad++ Prompts to reload
WebStorm Automatically reloads

It looks like this might be a personal preference thing by the creators of each editor. I will look into this as an optional addition to file-watcher but I do not know if I can intercept the base Atom behaviour.

from file-watcher.

zessin avatar zessin commented on July 18, 2024

+1 for this feature.
Imagine you're analysing a log file from a running application that updates this log file. Auto reloading the log file is awful!
As far as I know, the default behaviour on Atom is to auto reload the file, and there is no option to set it to prompt you for a confirmation to reload.

IMO, it would be nice having a way to get a prompt confirmation for reloading the file (no matter if it has changes or not).

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

I have been looking into this and it might require an update to TextBuffer since it does not expose the event that the file on disk has changed unless there is a conflict.

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

Resolved by 52bb9c0

I added an option (off by default) to file-watcher where it will intercept file change events before text-buffer reloads. It does this by faking out the conflict status.

I had to re-register the text-buffer file events due to an order of operation issue, but it does work for now.

If this is a feature you want please make sure you check the option in settings.

I'm closing this issue for now but I'll re-open it if this solution is inconsistent.

Thanks!

from file-watcher.

farvardin avatar farvardin commented on July 18, 2024

Thanks a lot for adding this important feature!! (It's also working this way with the Kate, Geany, gvim and Scite text editors, maybe it's more common to have this with Unix / Linux editors). I hope next releases of Atom won't break this option.

from file-watcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.