After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763128 - Clearing search highlight with Esc disables incremental search
Clearing search highlight with Esc disables incremental search
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-05 08:55 UTC by Fangwen Yu
Modified: 2016-03-07 01:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
search: set search text to empty to clear highlight (1.16 KB, patch)
2016-03-05 18:55 UTC, Fangwen Yu
committed Details | Review

Description Fangwen Yu 2016-03-05 08:55:38 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.
Comment 1 Fangwen Yu 2016-03-05 18:55:55 UTC
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.
Comment 2 Fangwen Yu 2016-03-06 15:28:56 UTC
Change component from search to editor, the search component
means global search, while this bug is related to search of the
editor component.
Comment 3 Christian Hergert 2016-03-07 01:33:24 UTC
Looks good, thanks!

Attachment 323159 [details] pushed as 28d84a8 - search: set search text to empty to clear highlight