Comments (6)
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.
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.
Ah I see what you mean. That sounds like a good feature, I'll work it into the next release..
from file-watcher.
Added in version 0.3.0
from file-watcher.
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.
Nice! ✔️
Added, patched and credited.
from file-watcher.
Related Issues (20)
- Path must be a string. Received undefined
- Changing Branchs HOT 3
- Add "Reload All" option HOT 5
- Reload all changes of the same file together HOT 1
- No prompt when using filezilla HOT 3
- File is not updated in Atom when it was edited outside Atom HOT 3
- Uncaught TypeError: this.editor.buffer.updateCachedDiskContents is not a function HOT 3
- Is there a way to make it work with PyCharm 'safe write'? HOT 1
- Failed to load the file-watcher package HOT 4
- Only show message once when file is foreground
- Uncaught (in promise) Error: Invalid encoding name: windows1252 HOT 2
- The plugin is not working with Atom 1.23.3 and macOS 10.13.2 HOT 1
- Prompt on change does not work on nfs files changed outside Atom HOT 1
- Not prompting on change and reloading automatically even with option turned off. HOT 4
- "Mounted file systems" in documentation is misleading. HOT 2
- file-watcher is completely inconsistent HOT 4
- AutoReload to confirm only if has unsaved changes
- Add an option to avoid bringing the atom window to the foreground when a file has changed HOT 2
- File won't reload when doing "git checkout"
- How this work in VisualCode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from file-watcher.