Skip to content

Commit 547beec

Browse files
Merge pull request #263 from X-Sharp/master
Fore removal of highlighted words when word is "rejected"
2 parents 282d17c + f7161ff commit 547beec

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
@@ -120,22 +120,21 @@ private void UpdateWordAdornments(TextExtent word)
120120
List<SnapshotSpan>? wordSpans = new();
121121

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

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

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

0 commit comments

Comments
 (0)