Sublime Forum

How to force save file (even w/o changes)

#1

With ST, when you try to save a file that hasn’t had any changes done to it since the last time you saved it, it doesn’t appear to save. Is it possible to force the file to resave even if no changes occur?

The reason I ask, is when editing web files via an SFTP/FTP connection, if I press save on a file (like a css file or something), then the SFTP client senses a change, then it uploads the new file. Sometimes, if I press save, then immediately switch over to my browser and hit refresh to see the latest changes, the page is messed up because I’m trying to access the page at the exact moment when it’s being overwritten. And for some reason, I have to go back to ST, make another change, then his save again, and this time wait a second or two before hitting refresh. I’m not sure why this is. I think it’s something to do with the web server accessing a file that is currently being overwritten and it ends up serving garbage or nothing to do.

Anyways, it would be nice if I could force save the file every time I pressed save, even if there were no changes to the file since the last save. This would allow me to simply switch back to ST and hit save again instead of having to make some minor pointless change.

0 Likes

#2

I can’t recall off the top of my head for S2, but S3 will always write the file to disk when you hit save. You can verify if it is or not via the Console.

0 Likes