Git Product home page Git Product logo

file-watcher's People

Contributors

lwblackledge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

file-watcher's Issues

Keep current version and reload

Thanks for a great package! I was surprised Atom doesn't have this feature by default, as it can destroy changes made outside of Atom...

However, it would be nice to be able to keep Atom's current version before loading the changed on-disk version of the file.

This could be done by either saving a backup version or (preferably) open a new tab with Atom's version of the file, before reloading the on-disk version.

Uncaught TypeError: this.editor.buffer.updateCachedDiskContents is not a function

[Enter steps to reproduce:]

  1. Be on Atom Beta.
  2. Open a file.
  3. Change the file on disk.
  4. Click the reload button on the file-watcher dialog.

Atom: 1.19.0-beta1 x64
Electron: 1.6.9
OS: Mac OS X 10.12.4
Thrown From: file-watcher package 1.1.0

Stack Trace

Uncaught TypeError: this.editor.buffer.updateCachedDiskContents is not a function

At /Users/hperrin/hperrin-configs/atom/packages/file-watcher/lib/file-watcher.coffee:88

TypeError: this.editor.buffer.updateCachedDiskContents is not a function
    at FileWatcher.module.exports.FileWatcher.forceReload (/packages/file-watcher/lib/file-watcher.coffee:88:22)
    at FileWatcher.module.exports.FileWatcher.confirmReload (/packages/file-watcher/lib/file-watcher.coffee:103:8)
    at /packages/file-watcher/lib/file-watcher.coffee:62:10)
    at emitTwo (events.js:106:13)
    at StatWatcher.emit (events.js:191:7)
    at StatWatcher._handle.onchange (fs.js:1376:10)

Commands

Non-Core Packages

atom-autocomplete-php 0.25.6 
atom-material-ui 2.0.4 
atom-typescript 11.0.4 
autoclose-html 0.23.0 
busy-signal 1.4.3 
color-picker 2.2.5 
emmet-simplified 2.5.0 
file-icons 2.1.8 
file-watcher 1.1.0 
git-plus 7.9.3 
gl-light-syntax 3.0.0 
highlight-selected 0.13.1 
intentions 1.1.2 
javascript-snippets 1.2.1 
line-diff-details 1.8.0 
linter 2.2.0 
linter-csslint 1.3.4 
linter-eslint 8.2.1 
linter-phpcs 1.6.7 
linter-tidy 2.3.1 
linter-ui-default 1.6.2 
minimap 4.28.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
minimap-linter 2.0.0 
pigments 0.39.1 
resize-indent 0.3.0 
slack-ui 0.8.0 
spacegray-light-neue-ui 0.1.7 
tab-switcher 1.5.4 
todo-show 1.11.0 
tree-view-git-status 1.4.0 

Add "Reload All" option

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.

Reloading a file that was edited in another editor does not work.

I am using Atom 1.10.2 & editing my file in PyCharm.

When I change the file in PyCharm, I get a prompt that the file was changed, but when I hit "Reload", the file just closes, and does not reload.

I think it has to do with Atom messing with the file too: whenever a change was made to it by another process, Atom automatically loads the old version as 'filename.ext__jb_old__' (and closes the original). So the dialog I get from file-watcher actually refers to 'filename.ext__jb_old__' as the file that was changed!

TL; DR: I believe a change in the latest Atom version is causing that problem but since I just started using it I do not know for sure.

Error deactivating package 'file-watcher' TypeError: Cannot read property 'destroy' of undefined

Whenever Atom gets reloaded or the package is disabled I see the following stack trace in the console:

Error deactivating package 'file-watcher' TypeError: Cannot read property 'destroy' of undefined
    at FileWatcherInitializer.deactivate (file:///C:/Users/Landon Abney/.atom/packages/file-watcher/lib/init.coffee:39:16)
    at Package.module.exports.Package.deactivate (C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\package.js:668:20)
    at PackageManager.module.exports.PackageManager.deactivatePackage (C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\package-manager.js:632:12)
    at C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\package-manager.js:618:19
    at Config.module.exports.Config.transact (C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\config.js:312:16)
    at PackageManager.module.exports.PackageManager.deactivatePackages (C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\package-manager.js:612:19)
    at AtomEnvironment.module.exports.AtomEnvironment.unloadEditorWindow (C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\atom-environment.js:815:21)
    at WindowEventHandler.module.exports.WindowEventHandler.handleWindowBeforeunload (C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\window-event-handler.js:212:30)
    at C:\Users\Landon Abney\AppData\Local\atom\app-1.12.0-beta1\resources\app.asar\src\window-event-handler.js:3:59

Currently seeing this on Atom v1.12.0-beta1, but I've been seeing it for a while.

Is there a way to make it work with PyCharm 'safe write'?

This is a feature request not a bug report.

File Watcher fails to simultaineously work with PyCharm. Seems like PyCharm first renames the original file (appends __jb_old__) then writes modified file as new file with old unmodified name. So the file in Atom only changes it's name (name + __jb_old__).

I need this feature to write code in PyCharm and to execute via Atom-Hydrogen-Jupyter.

PS

Though Notepad++ works with PyCharm flawlessly.

UPD
This is actually a PyCharm "safe write" function. If disable it then everything works OK. But still PyCharm (and other JetBrains software) support may be a good feature.

Doesn't work when editing files from a mounted directory

This package does not work when I'm using Atom to edit files from a mounted directory. The actual files are in a Unix machine, which I'm mounting in my Mac and editing using Atom.

It works when I'm editing a file that is in my Mac though.

Path must be a string. Received undefined

When you close a new file without saving it, it throws an error:

TypeError: Path must be a string. Received undefined at assertPath (path.js:7:11) at Object.resolve (path.js:1148:7) at Object.fs.unwatchFile (fs.js:1558:25) at FileWatcher.module.exports.FileWatcher.destroy (/home/julienc/.atom/packages/file-watcher/lib/file-watcher.coffee:128:9) at /home/julienc/.atom/packages/file-watcher/lib/file-watcher.coffee:52:8 at Function.module.exports.Emitter.simpleDispatch (/usr/lib64/atom/node_modules/event-kit/lib/emitter.js:25:14) at Emitter.module.exports.Emitter.emit (/usr/lib64/atom/node_modules/event-kit/lib/emitter.js:129:28) at TextEditor.module.exports.TextEditor.destroyed (/usr/lib64/atom/src/text-editor.js:534:27) at TextEditor.module.exports.Model.destroy (/usr/lib64/atom/src/model.js:31:58) at Pane.module.exports.Pane.destroyItem (/usr/lib64/atom/src/pane.js:645:18) at atom-tabs.TabBarView.onClick (/usr/lib64/atom/node_modules/tabs/lib/tab-bar-view.js:711:17)

AutoReload to confirm only if has unsaved changes

Hi,

I started using file-watcher only today, and it seems AutoReload function could do a little better job. The idea would be to force-reload changes only if there are no unsaved changes, otherwise, ask to confirm. Otherwise, when it simply force-reloads everytime, I can't really find a lot of use for it...

An even better idea would be to ask for confirmation only if there are conflicting lines, and merge automatically if changes are unrelated to unsaved edits, but I imagine that can be harder to implement.

Failed to load the file-watcher package

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.19.3 x64
Electron: 1.6.9
OS: Linux Mint
Thrown From: file-watcher package 1.2.4

Stack Trace

Failed to load the file-watcher package

At unexpected = in /home/nighty/.atom/packages/file-watcher/lib/file-watcher.coffee:88:81

SyntaxError: unexpected =
  at /packages/file-watcher/lib/file-watcher.coffee:88:81

Commands

Non-Core Packages

atom-beautify 0.30.5 
atom-cli-diff 1.9.0 
atom-django 0.3.2 
atom-meld 0.3.5 
atom-python-virtualenv 0.14.0 
atom-transpose 0.3.4 
autocomplete-python 1.10.2 
blame 0.12.0 
busy-signal 1.4.3 
custom-title 1.0.1 
data-atom 0.25.2 
DjangoRAD 0.0.1 
emmet 2.4.3 
emmet-snippets-compatibility 1.0.6 
file-watcher 1.2.4 
git-plus 7.9.3 
git-time-machine 1.5.9 
hyperclick 0.1.3 
indent-guide-improved 1.4.13 
intentions 1.1.5 
language-django 0.1.1 
language-nginx 0.8.0 
linter 2.2.0 
linter-pycodestyle 2.1.2 
linter-pylint 2.1.0 
linter-ui-default 1.6.7 
local-history 4.3.0 
merge-conflicts 1.4.5 
minimap 4.29.6 
minimap-linter 2.0.2 
monokai 0.24.0 
open-html-in-browser 0.2.0 
open-terminal-here 2.3.1 
persistent-undo 1.2.0 
project-manager 3.3.5 
python-tools 0.6.9 
selection-highlight 0.1.6 
sort-lines 0.14.0 
symbols-tree-view 0.14.0 
tag 0.5.0 
termination 0.6.0 
up2date 0.1.2 
Zen 0.18.0 

Additional diff option

Would it be possible to add a setting so one could use a different differ?
ie "split-diff"

Doesn't work if file is deleted and created again.

I'm working on an ePub and very often unzip it to edit it's contents.
It involves using a script to unzip the .epub package. The script gets rid of the old folder first and then creates a new one with the same name. I understand that file-watcher is just loosing track of the original files therefore it's not reporting any changes in the files. It would be nice to have this functionality. Even worse is that atom itself requires to close the current file and open it again from tree view.

To reproduce:

  1. create a folder "test"
  2. create a file "test.txt" inide "test" folder
  3. open the file in atom using the tree view, type in some text, save file
  4. delete the folder "test" and it's contents
  5. create the folder "test" again
  6. create the file "test.txt" inside "test" folder again
  7. switch back to atom (there are no prompts that the files were changed or deleted)
  8. do not close the file in atom – try to open the same file from the tree view (it brings the focus to your opened file but your not really editing the file from the tree view)
  9. to edit the new "test.txt" file: close the file in atom. open it again with tree view.

I hope you see the problem. I'm not sure if it's atom's issue but i hope you could add this functionality to you plugin.
Cheers!

Prompt on change does not work on nfs files changed outside Atom

Hi,
I have Ubuntu 16.04.3 LTS, and I installed recently the latest file-wacher from Atom packages.
I have a file on a NFS mount, which I change outside of Atom. Atom reloads it automatically without prompting there was a change.
I have checked the "Prompt on change" check-box in settings.
I also checked "Use WatchFile --RELOAD REQUIRED", since my file is on a mounted file system.

Regards,
Mirela

The plugin is not working with Atom 1.23.3 and macOS 10.13.2

Hello!

After losing some work with Atom due to git reset, I discovered you plugin but seems it is not working with the latest Atom and macOS.

Can you take a look at it? Is there something that I can do to help?

Thank you! This plugin really fixes an annoying problem with Atom =)

atom splitscreen

prevent atom from removing split screen on reloading document

file-watcher is completely inconsistent

This bug is repeating a few things in other watch posts, but I wanted to collect my bugs here:

  1. If Atom is not in focus, it does no reloading

  2. It always automatically reloads if there's no edits in Atom

  3. It never reloads if there are edits in Atom

Version: Atom 1.29.0 x64 Windows

I have "Prompt on Change" and "Include the compare option" checked. "Reload Automatically" is UNCHECKED but the settings are completely disregarded.

I tried with the "Use Watchfile" on - it sort of worked, but inconsistently. It will work once, but then if I reload as instructed it goes back to the broken behavior. Even if it is ON and I turn it OFF without reloading, I get asked properly.

It looks likes initialization just doesn't apply the options at all, and defaults to reloading automatically if there's no edits.

Only show message once when file is foreground

Hi,
thank you for this plugin. I use it daily.

When a file is changed I get a pop-up regardless of the file being in the front or a tab in the background.
It would be nice to have a option to only get notified on selection of the file...

Thanks,
73

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

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.

Reload all changes of the same file together

Subj, (also somehow related to #7 and #10 but not the same). Say one file is changed 3 times before I switch to Atom and get the pop-up. So when I switch to Atom, instead of getting one pop-up for the same file for the 3 changes together, I get two or more pop-ups, one for each change, on the same file.

I didn't check the internals, but it looks like file-watcher queues every change separately and asks about each of them. It would be much better to ask for reload of the same file just once treating all the changes as a single change.

No prompt when using filezilla

Hello
i'm using atom with filezilla. But when file change on disk, no prompt message to warn me.
Steps to reproduce :

  1. load a file in filezilla (a log file for example from your ftp) and open it with atom.
  2. Make changes on your website to generate some logs.
  3. Reload the file from filezilla
  4. Atom display the file with the blue dot on the tab (of file name) but file watcher doesn't prompt anything.
    Need to close the file without saving and re-open it so see the changes on my log file.

Changing Branchs

When I change branchs I get annoyed by the reload popup.
Isn't there a way to check if the branch has been changed and not ask for reloading?

activate split diff

Hello,
I like this package a lot thank you.
One thing which is unfortunate is when you use the compare option there is no highlighting of diffs.
On my installation I have fixed that by installing the split-diff package and triggering it when the compare happens.

It is a one line change

  atom.commands.dispatch(document.querySelector('atom-text-editor'), 'split-diff:toggle')

added after line 80 of file-watcher.coffee

It would obviously be better if a service api existed on split-diff but in the meantime I think this would be a worthwile improvement

How this work in VisualCode

I like this plugin for confirm if file modified in another
but can this work in visualcode ?
because I still work with atom because this plugin, but atom just still until this end year, so will migrate to visualcode but I'm not got plugin like this (confirm if detect modified in another applications)
can somebody give information for this ?

Ask only once

It would be nice if instead of notifying me for each change, I would have the option the ignore all future changes to a file and only view the current state.
This is especially useful for log files that are still active.

file-watcher doesn't work on changes via sshfs

I have a Problem with files which have changed in my VM. I work with a VM (Debian) in virtualbox which is mounted via sshfs on my mac.
If I edit files on my mac, the vm recognize the changes, but atom doesn't recognize changes, which were made in the vm.

Have you an idea why i have this problem?

Not prompting on change and reloading automatically even with option turned off.

Hi, just installed Atom and file-watcher on Fedora 28 KDE.

If I have an open file on Atom and on another editor, any change made outside is automatically loaded on Atom without any prompt, even with the setting "Reload Automatically" turned off.

I have tried with settings "Use WatchFile" and "Include the Compare option" turned on an off, to no avail.

Thanks.

Doesn't work for files stored in the root directory of the disk (Atom 1.4.3 on Windows 10 Pro x86)

I have a fresh Atom setup (v1.4.3) on Windows 10 Pro (x86), with the "file-watcher" package installed. "Include the Compare" and "Prompt on Change" options are enabled. I create a file in Atom, put some contents in it, and save it to "D:\123.txt". I then open this file in another text editor, add more contents to it, and save it. I then switch back to Atom (which i didn't close, and inside which I still have the "D:\123.txt" file open) and there is no prompt of any kind informing me that the file has changed on disk.

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.