Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

40 restore connection #58

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

KES777
Copy link
Collaborator

@KES777 KES777 commented Sep 21, 2015

Resolves this issue

Please apply only after other my pull requests #54 and #55

KES777 added 29 commits May 14, 2015 19:49
Now you can 'INSTALL_PREFIX=~/bin ./ssh-copy-rsub [user@]host' to install into
home directory
rename: temp_path -> temp_file
This is ROOT temporary working directory
Here we relay on sublime feature when we open same file
Also if we open files with same names sublime will distinguish them and
pretty show additional directory path on tabs
This occour when we edit remote file and plugin was reloaded. After this
SESSIONS is empty. So...
When we start remote edit iterate all views that related to 'rsub'
if it is related

    bool( env )

and is not in current session (belongs to old disconnected session)

    not v.id() in SESSIONS

and file were opened from same host

    self.env['host'] == env['host']

and same file were opened

    self.env['real-path'] == env['real-path']

So we put this view to current session in bring_to_front

                self.env['work_dir'] =  env['work_dir']
                SESSIONS[ v.id() ] =  self
                self.temp_file =  v.file_name()
                self.send_save()
                sublime.active_window().focus_view( v )
                bring_to_front()
                return
Because each session save tmp files in its own random directory
we must track where view save its buffer for disconnected session (when plugin were reloaded)
The view can be restored from old session. The old session WORKDIR != current session WORKDIR
When we restore session we must update remote file by local modifications
So they will not be lost
@bantmen
Copy link

bantmen commented Mar 5, 2016

This would be very appreciated.

@randy3k
Copy link
Contributor

randy3k commented Aug 30, 2017

Due to the slow development of rsub, I am now maintaining a fork of rsub at https://github.com/randy3k/RemoteSubl
and it has included this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants