Closed vovkkk closed 9 years ago
So you mean if you have "autosave on focus lost" enabled, ST trims trailing whitespace on save because it thinks it lost focus? That's bothersome. I'll check for this and report it on https://github.com/SublimeTextIssues/Core.
The way you implemented this is problematic however, because it will remove the read_only state even if only the insert_date
command was called. I'll implement this differently, but thanks for the heads up.
Yes, in many cases when you got cursor outside of previously active view (quick panel, console, go to anything, search, etc.), then it considers a focus is lost.
Those settings are "save_on_focus_lost": true
& "trim_automatic_white_space": true
.
Oops, those are "save_on_focus_lost": true
& "trim_trailing_white_space_on_save": true
.
BTW, generally speaking, especially as a person who uses and appreciates both features/settings, I’d say that it is good, rather than bad, again generally speaking; because more saves is good thing in absence of proper autosave.
But yea, perhaps it should make exception for quick panel, since it is kind of basic way to offer custom input for 3rd party plugins.
FWIW, ST3 has show_popup_menu
which keep focus in the view, but it’s not available in ST2.
show_popup_menu
isn't really suited as well as a quick panel for this task though.
I think I found a good way to work around this issue, which I reported at https://github.com/SublimeTextIssues/Core/issues/980 btw.
Will push a new release once I figured out how I can solve #25.
ST has two [arguably] useful features, which are disabled by default, iirc:
The issue is that quick panel is counted as lost focus.