Sublime Forum

Sublime Text 3 reverts saved file after a few seconds

#1

Hi,

My ST3 recently started giving me problems with saving files. Working on my project, which is hosted locally on my machine only, every now and then when I make changes in a file and save it it does not actually save the changes. The problem is that the changes indicator on the tab disappears once Cmd + S is hit. However, having fixed the bug and trying to compile the project again it fails because the changes are not present anymore. It seems like the save is reverted a second or two after. Important note, ST3 doesn’t crash or complain.

I have had a look at similar topics online but most people who have problems with saving usually report they’re working on remote files. Others report that their ST crashes or brings up warnings. Mine hasn’t displayed anything.

Thanks.

Kind regards,
Thomas

0 Likes

#2

what plugins do you have installed? maybe one of them is reverting the changes?

0 Likes

#3

From “Preferences” > “Package Settings” > “Package Control” > “Settings - User” I’ve found:

CMake, Markdown Preview, Package Control

Thanks.

0 Likes

#4

Could it be because I boot ST3 from my terminal with subl . (to open the current directory). I noticed I get something like

“no files were indexed out of the 287 queued, abandoning crawl”

0 Likes

#5

Disable them all and test if it stills working.

If not work, backup all your settings and revert Sublime Text to a clean state and test if it is
working. It should, then start installing your settings until you find out what is breaking it.

Some useful links:

  1. Complete clean install proceedings
  2. Reverting to a clean state (backup your data)
0 Likes

#6

Hi again,

I have tried clean installing sublime text and for sometime the problem didn’t occur until now.

The problem is that for some reason sublime text reloads the file after I start the compilation of my project via iTerm2. Just to clarify, I haven’t booted sublime text via the terminal specifically with this file.

I have also managed to capture the issue with screen capturing. You can see the video here. At the bit where the screen skips all I do is click on sublime text to bring it forward, at which point it reloads the file and discards the keyword ‘overload’.

Thanks!

0 Likes

#7

The way the file gets modified as a part of the build process would make it appear as though the file you have open is one that is being either generated by the build system (i.e. from some template file) or is being copied from some other location in the project into the location of the file you have open.

For verification purposes I would make the change to the file you’re referencing here, then open it in another text editor and verify that the change is there (also verify that the path is identical), then run the build and see if both editors think that the file has changed on disk or not.

0 Likes

#8

Yes, indeed that’s how a file gets modified by a project. That’s not the case here, unfortunately. The file is not automatically generated or modified by the project and I cannot reproduce that bug anymore. Also, my teammates that work with Atom never had such an issue.

I’ll definitely try what you suggested next time I experience this issue again.

Thanks.

0 Likes