Git Product home page Git Product logo

Comments (6)

lwblackledge avatar lwblackledge commented on July 18, 2024

Hi @kankaristo thanks for trying this out.

I believe that this is already possible if you select Ignore on the prompt that appears if you have local changes. If you select Ignore I do not reload the file from disk. You are then able to save over the disk changes from atom, or save it as a separate file as normal.

Is this not working for you?

from file-watcher.

kankaristo avatar kankaristo commented on July 18, 2024

Yes, that's working. My description is a bit convoluted, sorry about that. 😊

I meant that it would be nice to open the 2 different versions into separate tabs automatically. So the dialog would have 3 options: "Ignore", "Open both", "Reload (overwrite buffer)".

This way you could compare the 2 versions side by side, without having to save a "temporary" version to a second file.

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

Ah I see what you mean. That sounds like a good feature, I'll work it into the next release..

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

Added in version 0.3.0

from file-watcher.

kankaristo avatar kankaristo commented on July 18, 2024

Fantastic! 👍

A small improvement; set the grammar (syntax highlighting, autocomplete, etc.) for the unsaved file:

 confirmReload: ->
     currPath = @editor.getPath()
     currEncoding = @editor.getBuffer()?.encoding || 'utf8'
+    currGrammar = @editor.getGrammar()

     choice = atom.confirm
       message: path.basename(currPath) + ' has changed on disk.'
       buttons: ['Reload', 'Compare', 'Ignore']

     return if choice is 2

     if choice is 0
       @editor.getBuffer()?.reload()
       return

     compPromise = atom.workspace.open null,
       split: 'right'

     compPromise.then (ed) ->
       ed.insertText fs.readFileSync(currPath, encoding: currEncoding)
+      ed.setGrammar currGrammar

from file-watcher.

lwblackledge avatar lwblackledge commented on July 18, 2024

Nice! ✔️
Added, patched and credited.

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.