Sublime Forum

Save command cannot be called from code?

#1

Problem: In a few of my scripts, I used to save the current file before running it through external tools. However, this no longer appears to work.

Steps to reproduce: Create a new file. Type something in so the file is modified. Open a console. Type window.run_command(‘save’) and press enter. Nothing happens.

If you replace save with save_all it does work correctly, but for the sake of safety I’d prefer only saving the current file. Strangely, the ctrl+s keyboard shortcut works just fine, even though it calls the exact same command. Is this a bug or is there an alternate way to save files from code?

0 Likes

#2

I’ll put this on the todo list to implement; there isn’t a way to access it from plugins yet.

0 Likes