[followup](https://github.com/geany/geany/issues/1969)
1. The user specify a max file size in the settings. 2. Before opening files bigger than the specified size, a confirmation dialog is shown, giving the option to cancel.
use-case: possibly prevents Geany freezing when opening big binary files by accident.
As I explained in #1969 the slowness is because the buffer has to be UTF-8 and the default is to try all known encodings to convert the file if the encoding is not defined. (see `Document->Set encoding` for a list, its quite a few). Yes Geany will "freeze" while that happens, but it stops looking at the first success, and should not crash.
Big files that are valid UTF-8 or where the user specifies the encoding on the open dialog should not be unreasonably slow (relative to the actual machine).
I guess if "somebody" made a PR to show a warning dialog when the file size is greater than some setting, with the setting having the default value of `SIZE_MAX` so it won't annoy by default, it might be accepted. But it probably won't help most people since they won't have set a value when they accidentally open a big file that has an encoding that can't convert to UTF-8. And how they pick a value to use I do not know.
github-comments@lists.geany.org