Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit caab81d

Browse files
Googlernshahan
authored andcommitted
Append the alias in the suggestion for go-to search to make it more clear to
users why that suggestion appears for the given query. PiperOrigin-RevId: 179455250
1 parent 1d827a4 commit caab81d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/model/ui/highlighted_text_model.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ class TextHighlighter {
7676
break;
7777
} else {
7878
if (!matchFromStartOfWord ||
79-
(index == 0 || _matchText[index - 1] == " ")) {
79+
(index == 0 ||
80+
// Some suggestions will have an alternate label appended to
81+
// the end of the suggestion and enclosed in parenthesis. We
82+
// want to highlight matches to words that are wrapped in
83+
// parenthesis so we add this check here.
84+
_matchText[index - 1] == "(" ||
85+
_matchText[index - 1] == " ")) {
8086
markers[index] = max(markers[index], token.length);
8187
}
8288
index += token.length;

0 commit comments

Comments
 (0)