A save command without side-effects
It would be nice to have a save command that does not produce any side effects, but only saves the view/buffer to file.
Currently, the save command is customized for for the use case where the user asks for the file to be saved, typically by pressing cmd+s (or ctrl+s). However, this action has side effects other than just saving the file. Most prominently, the save command will close auto-complete panels.
The problem: While the side-effects make sense when save is requested by the user, they make life harder for plugin developers who would like to save the file without closing auto-complete panels (or invoking other side effects). The auto-save package is one example of a plugin that has had to develop overly-complex solutions to work around the side effects of the save command.
The solution: Add the ability in the API to save the buffer without invoking side effects. It doesn’t matter too much exactly how this is done - whether via a completely new command, or through a keyword argument to the existing save command.
Importance: Minor (but also simple to implement…)
Notes (based on other comments):
- Writing directly to file without using ST’s API doesn’t work well, since users get “File has changed on disk” messages every time the file is auto-saved (depending on their configuration). Doing things “the right way” means saving the view/buffer using Sublime’s API.