Sublime Forum

Issues with save_on_focus_lost, Command Palette, and Revert

#1

Command Palette and Revert do not mix well when save_on_focus_lost is turned on. As soon as the Command Palette is summoned, any pending changes get saved to the file, and subsequently invoking Revert is flogging a dead horse.

Is there a way to change save_on_focus_lost behavior so that displaying Command Palette does not trigger saving? Visually the current tab did not lose focus, it’s still the active tab after all.

0 Likes

#2

Opening the command palette does make your file lose focus. The command palette input now gets the focus and your active file looses focus.

0 Likes

#3

Well, I guess that depends on how you interpret “having the focus lost”. Off the top of my head, I could think of two different definitions for it:

  1. the input control no longer has the caret blinking in it
  2. the actual tab no longer being the actual tab (no matter how confusing that definition might be).

However, the Preference.sublime-settings file has its own short definition attached to the setting save_on_focus_lost:

Set to true to automatically save files when switching to a different file or application

None of those apply when you invoke the Command Palette. No switching to other files or applications happens.

0 Likes

#4
0 Likes

#5

Thanks for bringing this to my attention, @kingkeith, I’m adding this issue to that list now.

0 Likes