As you mentioned in https://github.com/geany/geany/issues/3946, using the GIO method only might be best for config files indeed and I can modify the patch if this is the preferred way. With this patch I just wanted to make sure that `fwrite()` isn't used as the default method for saving config files which IMO is the worst option of them all.
Only https://github.com/geany/geany/issues/3946 and @techee (during debugging)
Over years, this happened to me quite a few times and
Geany, to my recollection is the only application that yields that erratic behaviour
from #3946 resonated with me because Geany really is the only application where I experienced this and it's kind of embarrassing. It's true that I haven't seen it for a long time but I suspect it's because file systems got better rather than fixing something on the Geany side.