Switch to asynchronous search
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:
- the display of the number of matches in the search bar, instead of the "Highlight All" button;
- this button is moved in the menubar ("Search" menu), where it appears as common to the search bar and the replace dialog without overloading either of them;
- the display of a spinner when the search is in progress, instead of an outdated or empty occurrences count, both in the search bar and the replace dialog;
- a better behavior when the documents change (buffers or tabs);
- a better consistency between the search bar and the replace dialog when used together, within the limits of what is possible.
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.
Merge request reports
Activity
added 12 commits
-
effd6143...467c26d9 - 2 commits from branch
apps:master
- 6ebc69e5 - Switch to schema-id format for the setting names
- da1873e9 - Code refactoring around GAction-GSettings binding
- ec92c6b7 - Reformulate "Home/End Keys" setting description
- 6f99ce48 - Display whitespace as allowed by GtkSourceView 3.24
- 5f125546 - Restrict choices to space locations
- 45fe8fa3 - Hide the whitespace location settings
- d5f8936d - Add a TRACE macro for personal testing
- 5e977f34 - Switch to asynchronous search
- 50efa713 - Make the occurrences count appear in the search bar
- ff3667b4 - Connect the search bar to the "switch-page" signal
Toggle commit list-
effd6143...467c26d9 - 2 commits from branch
added 7 commits
- 1ca9a6c4 - Display whitespace as allowed by GtkSourceView 3.24
- 284b64d1 - Restrict choices to space locations
- 3e723067 - Hide the whitespace location settings
- 29b52751 - Add a TRACE macro for personal testing
- 842b3b39 - Switch to asynchronous search
- 6b6839d6 - Make the occurrences count appear in the search bar
- b75225fd - Connect the search bar to the "switch-page" signal
Toggle commit listResolve conflicts after !57 (merged).
I have encountered some situations where the idle added in !13 (merged) to fix #26 (closed) wasn't sufficient, so in the hope that this fixes this issue once and for all.
NB: I prefer to not add this commit to Mousepad 0.5, in case it would have side effects.
I did well: it has side effects -> reverted
Edited by Gaël Bonithonmentioned in commit 70514a3c
added 13 commits
-
4e0e882a...70514a3c - 2 commits from branch
apps:master
- 399dc2f9 - Switch to schema-id format for the setting names
- 8aab6a25 - Code refactoring around GAction-GSettings binding
- 54e2343e - Reformulate "Home/End Keys" setting description
- 482f887c - Display whitespace as allowed by GtkSourceView 3.24
- d76e1399 - Restrict choices to space locations
- d06f736f - Hide the whitespace location settings
- 0c0a9be8 - Add a TRACE macro for personal testing
- d1bb915c - Switch to asynchronous search
- cecd4cf3 - Make the occurrences count appear in the search bar
- 9a201128 - Connect the search bar to the "switch-page" signal
- c144d928 - Add a spinner to the search widgets
Toggle commit list-
4e0e882a...70514a3c - 2 commits from branch