K
K
Keeprock2015-05-10 13:07:17
Sublime Text
Keeprock, 2015-05-10 13:07:17

How to automatically update the contents of open files in Sublime Text 3 when they are changed externally?

Bottom line: Sublime Text does not update open files if they have been updated externally. Thus, when working with jade, for example, I can't see the changes in the open file right away. You have to open it and close it again or do File->Revert.
You can put a plugin that updates the content after a certain time AutoRefresh .
You can do self.view.run_command('revert') through the console and set an interval, but again, these are intervals. And intervals are a constant renewal that we would like to avoid.
Who and how solved this problem tell me. Thank you!
ps offers to move to other IDEs or Brackets are not accepted (Brackets has the same problem) :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2015-05-10
@HeadOnFire

Sublime Text 3 silently, without asking, updates the contents of a file if it has been changed externally. If the file has unsaved changes made in the editor itself PLUS changes from outside - ST will ask the question "XXX Has changed on disk. Do you want to reload it?" Clicking OK will load external changes, and unsaved changes made in the editor itself will be lost. So this function is out of the box, test it on a simple text file (I just checked - everything works as it should). The only thing missing is if there is a change conflict (see above) for ST to show diff and offer the option to merge the changes.
Update: It's also a good idea to install a plugin for working with Git + GitGutter, and if your file is under CVS control - handy pointers in gutter (column on the side, with line numbers) will make it easier to navigate through the current changes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question