Sublime Forum

Save All not saving all (sometimes)

#1

I’m noticing that the “Save All” operation, on my Mac bound to command-opt-S, does not always actually save all modified buffers. I can perform that operation while on a modified tab, and then hit command-S (simple “Save”), and the buffer is reported as being saved in the bottom bar of the window.

There’s no pattern that I can find to what triggers the failure to save. Sometimes “Save All” does save all modified buffers, and sometimes it doesn’t. For a while I thought I was just imagining things, but it’s happening more often than I’d like (more often than never, really) and so I’m being very observant about what keys I’m hitting.

I’ve also noticed that I can hit command-S in a buffer, and do nothing else, and then hit it again and again three or four times, and I get another report in the status bar that the file has been saved.

Saving files successfully seems like a pretty fundamental job for an editor, which is why it’s so surprising (and annoying) to have to constantly worry about it, not to mention wasting test cycles on a change that never made it to the build system.

I’m on Stable 4143, MacOS 13

0 Likes

#2

There’s nothing obvious as to why save all shouldn’t be working. Is it just doing nothing? If you enable command logging (sublime.log_commands(True) in the console (View > Show Console)) does the "save_all" command get logged?

I’ve also noticed that I can hit command-S in a buffer, and do nothing else, and then hit it again and again three or four times, and I get another report in the status bar that the file has been saved.

This is on purpose and desirable. There’s numerous situations where the file on disk may not match what Sublime Text last saved. Writing to the file also changes the file metadata which can be useful. Saving should always actually write to the file, otherwise it is prone to becoming unreliable.

0 Likes

#3

Thank you for your reply.

It’s certainly not obvious to me, but I will definitely turn that logging option on. I am 100% certain that the problem is real, as over the last couple days I have verified it with some simple experiments (leaving an easily searchable comment in a changed source file so I can grep it in a terminal, for example).

As to command-S saving all the time, I’m fine with that, because what harm could it do, but it’s also true that the reporting of the file being saved down in the bottom status/reporting bar does not happen on every command-S.

0 Likes

#4

The only time saving doesn’t notify in the status bar is when using "save_on_focus_lost" or passing "quiet": true to the save command.

0 Likes

#5

OK well I don’t know anything about that, all I know is that I don’t see the file path in the bottom status bar on every command-S. On some of them I do, maybe one in 4 or 5? The first one after modifications I’m pretty sure always.

0 Likes

#6

Does the save command get logged when it doesn’t show the message?

0 Likes

#7

I apologize, I have not started logging yet. I will do so and report back.

0 Likes

#8

I will keep the console open and try to pay attention as I’m doing things. The “Save All” operation only logs “save_all”, not the files being saved (which I admit would be kind-of a mess).

0 Likes

#9

“Save All” stops, if dirty scratch buffers are present, and the “Save As…” dialog is canceled. May something like that happen to you?

There are various open issues logged on Github about this topic.

see:

0 Likes