Switch to asynchronous search
Loading
Depends on !46 (merged).
The main purpose of this MR is to use asynchronous search, so as not to block the UI when searching in big files and/or with regex search enabled. This is almost required when the search mode is "find as you type", which is the case for Mousepad.
This is in itself a rather profound change that requires a lot of rethinking, but I also took the opportunity to improve and harmonize a few small things regarding the search bar and the replace dialog.
I tried to divide the changes into separate commits as much as possible, but the one directly related to the switch to asynchronous search is obviously bigger and harder to read than the others.
From the user's point of view, in addition to the gain in fluidity thanks to the asynchronous search, the main changes are:
Codewise, I made increased use of signals to connect the different widgets involved in the search, from the search bar and replace dialog to the documents, through the window and back.
One last thing: I had to trick a bit to avoid prohibitive computation times in some situations, because of (what I consider to be) a bug in GtkSourceView
(reproducible e.g. with Gedit in its current stable version): see https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/164
All this is duly commented in the code.