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 792885 - Find -> Clear Highlight doesn't work
Find -> Clear Highlight doesn't work
Status: RESOLVED OBSOLETE
Product: gnome-terminal
Classification: Core
Component: general
git master
Other Linux
: Normal minor
: gnome-3-28
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-24 23:01 UTC by Egmont Koblinger
Modified: 2021-06-10 21:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (394 bytes, patch)
2018-03-05 12:29 UTC, Egmont Koblinger
committed Details | Review

Description Egmont Koblinger 2018-01-24 23:01:46 UTC
.
Comment 1 Egmont Koblinger 2018-03-05 11:52:49 UTC
There are other small issues as well.

- Clicking in the terminal area removes the highlight of the current match (even if that click was made solely to give back focus to the terminal). Next/Prev shortcuts still work, but they start over. I'm not sure, I guess I'd expect mouse clicks to be irrelevant – although conflicting mouse highlight are sure a problem, but maybe we could defer removing the search highlight until selecting is started. And even then I guess searching should continue from the last location.

- Clear Highlight doesn't visually unhighlight the match, but otherwise cancels the search operation. Subsequent Next/Prev operations do nothing. Up/Down arrows of the existing Find dialog don't work either, at least not until the search word is left unchanged. The wording "Clear Highlight" suggests to me it should only affect the visuals; if canceling is desired then IMHO maybe the wording could go like "Reset Search" or similar.
Comment 2 Egmont Koblinger 2018-03-05 12:29:54 UTC
Created attachment 369327 [details] [review]
Fix

Fix (for $subject only).

vte_terminal_search_set_regex() cannot unhighlight automatically, because this one keeps getting called as you type the new regex, so it's expected that the visuals stay the same. (Semantically different behavior based on the NULL-ness of the new regex would be damn ugly.)

So, given the current APIs, the caller explicitly has to make sure to unhighlight.

(Another possible approach is for the caller g-t to perform a vte_terminal_search_find_next() using the freshly set NULL regex, plus a corresponding change in VTE to unhighlight before bailing in this case.)
Comment 3 Christian Persch 2018-03-05 12:50:49 UTC
(In reply to Egmont Koblinger from comment #1)
> There are other small issues as well.
> 
> - Clicking in the terminal area removes the highlight of the current match
> (even if that click was made solely to give back focus to the terminal).
> Next/Prev shortcuts still work, but they start over. I'm not sure, I guess
> I'd expect mouse clicks to be irrelevant – although conflicting mouse
> highlight are sure a problem, but maybe we could defer removing the search
> highlight until selecting is started. And even then I guess searching should
> continue from the last location.

I guess that's because vte abuses the selection to store the point of the current match highlight.
Comment 4 Egmont Koblinger 2018-03-05 12:53:31 UTC
(In reply to Christian Persch from comment #3)

> I guess that's because vte abuses the selection to store the point of the
> current match highlight.

Yeah I kinda realized this after making the comment :)
Comment 5 Egmont Koblinger 2018-03-05 12:59:06 UTC
Submitted. Not sure if we should keep this bug open for comment 1 – or perhaps they're just not worth the required refactoring.
Comment 6 GNOME Infrastructure Team 2021-06-10 21:21:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7817.