+4

File "forking" while editing

Borys Forytarz 7 years ago 0

Sometimes it would be useful to "fork" the file while editing. For example when you work on a file and you would like to check, i.e. two ways of implementation of some functionality. What you usually do is implementation of first version, then you comment it and implement second version (i.e. to compare speed or something else). This is the situation when file "forking" would be useful. How it should work? Its easy:

1. You open the file (let's name it A)
2. You fork the file (some keyboard shortcut maybe) - you get A1 file. Technically this is the second file buffer (copy) with its own view pointing to the same location on HDD
4. Now you can work on two versions of the same file simultaneously. When you save changes in A, this file will be written to HDD under its original location. When you save A1, the file will overwrite A, but not change anything in view to A (and vice-versa).


And what about version stored on HDD? Simply it is the latest you saved.

Please note that this is NOT file cloning, which is now implemented in Sublime. The main difference is that when you clone the file, each change is propagated between clone and original file. Forked file will not propagate the changes between each other.