Sublime Forum

Two persons editing the same file

#1

Hi

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.

0 Likes

#2

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?

0 Likes

#3

Here, read this topic. It’s somehow related to your problem.

0 Likes

#4

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.

0 Likes