newinnovations / remote-edit-ni

Atom package to browse and edit remote files using SSH and FTP. This fork supports atom 1.41.x and adds some new features.
https://atom.io/packages/remote-edit-ni
MIT License
18 stars 2 forks source link

[feature] Checking remote file for changes #50

Open urban-1 opened 5 years ago

urban-1 commented 5 years ago

Hi @newinnovations, it has been a while. Lately I am not using this plugin as much as I 'd like, however, I found sometime to write some code.

This PR introduces auto-refresh by checking the remote file(s) every N seconds. N comes from config and by default is 0 (disabled). The check is based on lastLoad and lastModified attributes which in turn are based 100% on the remote fs.stat() (no time parameters from the local machine). The behaviour is as follows:

Now, the banner mentioned above is a bit hackish. The reason is that atom notifications cannot do the job because (1) they are not persistent and (2) they float which means the notification might be for another tab the user doesn't see currently.

Being a bit lazy, I am just adding a new div on top of the atom-editor element. Each editor is associated with its own banner (ie banner not shared between editors). Furthermore, the banner has not been styled too much and might look a bit funny:

image

Caveats:

newinnovations commented 4 years ago

Hi @urban-1. Thanks for this, I will test-drive it for a while. Not been using this for some time myself, but that may change in the near future.