GNOME Bugzilla – Bug 763128
Clearing search highlight with Esc disables incremental search
Last modified: 2016-03-07 01:33:26 UTC
Clearing search highlight with Esc disables incremental search, i.e. the highlight is not updated as the user types and requires the user to hit Enter explicitly to highlight the matches. How to reproduce: 1) Hit Ctrl+F to bring up the search box, type search text, no problem with incremental search. 2) Hit Enter to highlight all the matches and hide search box. 3) Hit Esc to clear highlight. 4) Hit Ctrl+F to do another search, now the user has to hit Enter to highlight the matching text. Note that the 3rd step is necessary to reproduce the problem. How to recover: 1) Hit Ctrl+F to bring up the search box, type search text. 2) Hit Enter to highlight all the results since it can not do incremental search now. 3) Hit Ctrl+F to bring up the search box again, now the incremental search is back to normal. It seems that whether the user hit Esc is critical for the problem.
Created attachment 323159 [details] [review] search: set search text to empty to clear highlight When the cursor is in the source buffer and Esc is hit, "ide_source_view_real_clear_search ()" gets called, setting the "highlight" property to FALSE, so subsequent searches become non-incremental visually. The user has to do a rubberband search or hit Enter to bring back incremental search, which calls "ide_source_view_real_move_search ()" and set "highlight" back to TRUE again. This patch clears highlight by setting search text to empty, thus avoiding the problematic behavior.
Change component from search to editor, the search component means global search, while this bug is related to search of the editor component.
Looks good, thanks! Attachment 323159 [details] pushed as 28d84a8 - search: set search text to empty to clear highlight