Skip to content

Commit f7161ff

Browse files
Fore removal of highlighted words when word is "rejected"
1 parent 2cd5834 commit f7161ff

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/toolkit/Community.VisualStudio.Toolkit.Shared/MEF/SameWordHighlighterBase.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,21 @@ private void UpdateWordAdornments(TextExtent word)
121121
List<SnapshotSpan>? wordSpans = new();
122122

123123
string? text = word.Span.GetText();
124-
if (!_tagger.ShouldHighlight(text))
125-
return;
126-
127-
FindData findData = new(text, word.Span.Snapshot)
124+
if (_tagger.ShouldHighlight(text))
128125
{
129-
FindOptions = _tagger.FindOptions
130-
};
126+
FindData findData = new(text, word.Span.Snapshot)
127+
{
128+
FindOptions = _tagger.FindOptions
129+
};
131130

132-
System.Collections.ObjectModel.Collection<SnapshotSpan>? found = _textSearchService!.FindAll(findData);
133-
wordSpans.AddRange(_tagger.FilterResults(found));
131+
System.Collections.ObjectModel.Collection<SnapshotSpan>? found = _textSearchService!.FindAll(findData);
132+
wordSpans.AddRange(_tagger.FilterResults(found));
134133

135-
if (wordSpans.Count == 1)
136-
{
137-
wordSpans.Clear();
134+
if (wordSpans.Count == 1)
135+
{
136+
wordSpans.Clear();
137+
}
138138
}
139-
140139
//If another change hasn't happened, do a real update
141140
if (currentRequest == _requestedPoint)
142141
{

0 commit comments

Comments
 (0)