lite-xl-plugins
lite-xl-plugins copied to clipboard
Autosave bug
Hi (should I post this here or in the plugins page?)
- for me, 'autosaveonfocuslost' plugin doesn't work.
- 'autosave' plugin works, but if change focus before autosaving, it doesn't autosave anymore until another change in the code, even after refocus on tab.
Hi (should I post this here or in the plugins page?)
Yep, makes more sense for this to be there. I'll transfer this.
- for me, 'autosaveonfocuslost' plugin doesn't work.
- 'autosave' plugin works, but if change focus before autosaving, it doesn't autosave anymore until another change in the code, even after refocus on tab.
I'll give a look.
- for me, 'autosaveonfocuslost' plugin doesn't work.
Mmm, seems to work for me. What are your steps? Keep in mind that it's only saving the currently open and visible document. We could make it save everything tho.
- 'autosave' plugin works, but if change focus before autosaving, it doesn't autosave anymore until another change in the code, even after refocus on tab.
This plugin is a bit weird as it simply runs the save command (as if you were pressing ctrl+s, so targeted to the currently opened and visible file) after a timeout from the last change in any opened doc. So if you change tab before the timeout, it'll save the new selected tab. Yeah, we need to make this one more robust too...
For the focus issue with autosave
, this is an issue of Lite XL, as we try not to run anything while we're not in focus. We have a couple of ideas to remedy that, but the issue is still there.
Thanks
- I don't understand, do you mean my steps for unfocusing the tab? just by changing the tab or clicking on the left pane items and so on.
- The problem is that even when the tab returns to focus, the autosave doesn't work until the next change, as if it forgot that the tab remained unsaved. perhaps each tab could have some 'unsaved flag' so that the autosave plugin saves tabs with this flag when focus is lost or refocused or the app is closed. And it would have been better to have the option to save unsaved tabs when closing the tab or application, instead of the confirmation dialog for closing unsaved tabs.
- I don't understand, do you mean my steps for unfocusing the tab? just by changing the tab or clicking on the left pane items and so on.
The focus
the plugin works on, is the window focus, not the tab focus.
I guess it could be improved to handle that too...
- The problem is that even when the tab returns to focus, the autosave doesn't work until the next change, as if it forgot that the tab remained unsaved. perhaps each tab could have some 'unsaved flag' so that the autosave plugin saves tabs with this flag when focus is lost or refocused or the app is closed.
It's because the save command was sent to the tab that was selected when the timeout expired. So yeah, it's just that the plugin should keep track of which doc to save.
And it would have been better to have the option to save unsaved tabs when closing the tab or application, instead of the confirmation dialog for closing unsaved tabs.
Yeah I guess that could be improved. If you open an issue about it in the main repo, we'll keep track of that.
The focus the plugin works on, is the window focus, not the tab focus. I guess it could be improved to handle that too...
ok, sorry, I misunderstood, and it's clear in the plugin description.
Yeah I guess that could be improved. If you open an issue about it in the main repo, we'll keep track of that.
thanks again, and can you re-transfer it? :)
ok, sorry, I misunderstood, and it's clear in the plugin description.
No worries. The idea of saving on tab change could be implemented too.
Yeah I guess that could be improved. If you open an issue about it in the main repo, we'll keep track of that.
thanks again, and can you re-transfer it? :)
Might be better to create a new issue about it to avoid confusion, and to keep this here as a feature request about autosaveonfocuslost
as well as bug report about autosave
.
Hi.
autosaveonfocuslost
doesn't work for me, even if I change window focus.
I'm running on Hyprland wm.
It's possible that Hyprland doesn't let the window know that it lost focus.
Try running Lite XL in full Wayland mode like this: SDL_VIDEODRIVER=wayland lite-xl
.