OS: Windows 11 Geany Version: 1.38.0
https://user-images.githubusercontent.com/68846168/190093275-66dd14b0-2164-4...
I transferred the issue to the geany project as Save Actions is a core plugin.
@zhaolinlau Sorry about the delete, after the transfer it looked like you had accidentally posted the same thing twice, but anyway the templates is the same issue, when there is no file it produces a dialog, just another way of getting to that state.
Saving when focus lost is mainly for convenience when the user goes to do something else, saving on a timer is primarily for safety, minimising what may be lost if something goes wrong when typing.
The plugin use-case does not require saving delays of 1 sec, 30 secs is plenty (20-30 secs is what things like Google apps use, and they run over the internet). So in the meantime you can set the delay higher as a workaround.
As I said above the options are:
1. duplicate file saving from Geany in the save actions plugin without user interaction, a lot of work and any changes in Geany file saving need to be duplicated 2. refactor file saving in Geany, a lot of work and the possibility of different problems due to possible races
And another option might be for the plugin to check the return from `document_save()` and if its false stop trying to save that file for the rest of the session, will still get one dialog so the user is warned, but loses the safety net for that file. But is less work (the plugin just keeps a "don't save" list and checks every document against it).
But somebody has to do it[^1]
[^1]: trademark @eht16
I transferred the issue to the geany project as Save Actions is a core plugin.
Alright alright
Okay, I understand. I just propose my suggestion, because it would be very convenient if it could autosave every second. So we don't need to manually save the file by pressing ctrl+s. And I'm always work on web dev that's why I put the saving delays to only 1 second, because I want to speed up my workflow which is I just need to press alt+tab to switch to the browser and refresh to see the latest result without saving the web dev files.
And I'm always work on web dev that's why I put the saving delays to only 1 second, because I want to speed up my workflow which is I just need to press alt+tab to switch to the browser and refresh to see the latest result without saving the web dev files.
Whilst thats a perfectly good use-case, its not the one the autosave plugin was written to address, thats why it is only a partial fit.
There used to be a plugin in Geany-plugins, "web-helper", that had a built-in web page preview, but that never got converted to webkitgtk2 and nobody ships webkitgtk1 any more. Webdevs could perhaps resurrect it.
Or somebody could write a new plugin that does a simplified save, for example assuming utf-8 and doing none of the other transforms or checks. It could possibly also trigger the browser to save you the reload.
There used to be a plugin in Geany-plugins, "web-helper", that had a built-in web page preview, but that never got converted to webkitgtk2 and nobody ships webkitgtk1 any more. Webdevs could perhaps resurrect it.
I see
Okay, I understand. I just propose my suggestion, because it would be very convenient if it could autosave every second. So we don't need to manually save the file by pressing ctrl+s.
I cannot imagine you seriously want to save the current file every second, read every second?! Apart from the weird behaviour of the plugin in this specific use case, isn't this what you a huge waste of resources? It requires CPU and IO power and significantly reduce the lifetime of your disk (even if it's a SSD), so you need to replace it early than with a somewhat more normal behaviour.
As @elextr said, something like 30 seconds is probably a good compromise, it doesn't trigger that specific bug and more importantly it saves the planet and your money!
Okay, I understand. I just propose my suggestion, because it would be very convenient if it could autosave every second. So we don't need to manually save the file by pressing ctrl+s.
I cannot imagine you seriously want to save the current file every second, read every second?! Apart from the weird behaviour of the plugin in this specific use case, isn't this what you a huge waste of resources? It requires CPU and IO power and significantly reduce the lifetime of your disk (even if it's a SSD), so you need to replace it early than with a somewhat more normal behaviour.
As @elextr said, something like 30 seconds is probably a good compromise, it doesn't trigger that specific bug and more importantly it saves the planet and your money!
Most of the ides like eclipse, netbeans, microsoft visual studio and text editors like vscodium, notepad++, neovim now do support autosave in 1 second and 1 second is their default timer. So ya I'm serious because it's about convenience.
github-comments@lists.geany.org