Home Download Buy Blog Forum Support

Two persons editing the same file

Two persons editing the same file

Postby jooiiee on Sun Mar 03, 2013 10:01 pm


Our company is currently looking in to using sublime as our primary editor. So far sublime has been well received but there is one thing that prevents us from using it and that is the lack of a function warning users if the file is edited from another device. As far as I have been able to see, the editor loads the changes instantly. Is there a way to change this to the behavior that e.g. gedit has where the user gets a notification of the change?

As I understand it, there is also a good API for plugins but I could not find any plugins that does this. Would the API support us building our own plugin?

Thanks in advance.
Posts: 1
Joined: Sun Mar 03, 2013 9:59 pm

Re: Two persons editing the same file

Postby aleul on Sun Mar 03, 2013 10:56 pm

That doesn't seem like a responsibility of a text editor.

If it gave that warning there are only two scenarios, you lose your changes, or someone else loses theirs. I guess unless you save it locally, and then just merge the two files, which bring me to the next thing:

Has your company considered something like distributed version control (Git\Mercuial\etc)? That way everyone can have the files, and if two people edit the same file it turns into a merge, rather than someone losing work?
Posts: 3
Joined: Fri Mar 01, 2013 5:32 pm

Re: Two persons editing the same file

Postby iamntz on Mon Mar 04, 2013 4:40 am

Here, read this topic. It's somehow related to your problem.
Posts: 1035
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Two persons editing the same file

Postby mwb1100 on Mon Mar 04, 2013 8:18 pm

In my experience, ST only automatically reloads a changed file if there are no unsaved changes in the buffer. If the buffer contains unsaved changes when the file is modified outside of ST, you get a dialog asking whether or not you want to reload the file from disk. (Note: my experience is on Windows - I suppose that other platforms may have different behavior).

So there doesn't seem to be much danger of lost work. But it might be nice to have an option that will notify you of a changed file before reloading it regardless of whether or not the ST buffer is 'dirty'.

Also, even though using version control is a good practice, files can change for reasons other than two users making modifications simultaneously. For example, I might be looking at the output of a program that I'm debugging or I might have edited the file in some other tool for whatever reason. There are legitimate reasons to want to be notified of changed files that have nothing to do with version control.
Posts: 54
Joined: Mon Jun 25, 2012 5:40 pm

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 32 guests