Vscode: Save on focus lost

Created on 20 Nov 2015  路  7Comments  路  Source: microsoft/vscode

Greetings!

VS Code is an awesome editor. Thank you for that.
But is it possible to set-up "save on focus lost"?
When you are developing a web app using automated build-systems (gulp, webpack, etc...) its very annoying when is auto saves not completed code.
All editors auto save feature works with "focus" (Sublime, Atom, Webstorm...).

Thank you in advance!

feature-request file-explorer verified

Most helpful comment

This can now be configured with the new "files.autoSave": "onFocusChange" setting.

All 7 comments

I also need this, there's a slight delay during auto-save that I keep tripping on :(

Should be enough to just trigger auto-save on focus loss.

Are there any updates regarding this feature?

Status: It is on the backlog and we do not plan to provide this feature for the next milestone (December).

I am making progress on this feature request. I would like to avoid showing the dirty indication in the workbench at all cost because imho that is distracting. However this means, if you have configured auto save on focus change, the file will not be saved until one of these conditions without indication to the user:

  • you switch to another file or close the file
  • you quit the app
  • you move to another app so that code looses focus

Any feedback on this is appreciated.

This can now be configured with the new "files.autoSave": "onFocusChange" setting.

FYI, for those who stumble upon this thread, this confugration has changed to

"files.autoSave": "onFocusChange"

"files.autoSave": "onWindowChange" should be better.

Was this page helpful?
0 / 5 - 0 ratings