My blog has just been added to the planet GNOME!
I’m implementing a higher-level asynchronous API for the search and replace. I hope to finish this task in two weeks.
Then: regex search, adapt gedit, modernize the color schemes and ideally GtkTextTag to use CSS.
Search API, some progress
The highlighting of search matches works fine, there was a flickering issue that I fixed.
A property contains the total number of search occurrences. So while the user is typing the text to search, the buffer is scanned to highlight and count the number of matches. What will be really nice is that, once the buffer is entirely scanned, going to the previous/next occurrence will be a O(1) operation, thanks to
gtk_text_iter_forward_to_tag_toggle() (that’s why the matches must be highlighted even if they are not visible on the screen). It was more difficult to implement than always using
backward_search() to navigate through the occurrences, but I think it was worth the effort.
If you want to read more details, I’ve written a quite long implementation overview, with the problems to avoid, at the top of gtksourcesearch.c (it will also be useful to future maintainers).
I’ll continue to blog to explain my progress, so stay tuned!