未验证 提交 f75f5010 编写于 作者: J Joey Robichaud 提交者: GitHub

Merge pull request #32725 from JoeRobich/fix-duplication-in-FAR

Remove additive classifications when generating ClassifiedText from ClassifiedSpans
......@@ -69,7 +69,12 @@ protected override IList<System.Windows.Documents.Inline> CreateLineTextInlines(
.GetProperties(propertyId);
var highlightBrush = properties["Background"] as Brush;
var classifiedSpans = _excerptResult.ClassifiedSpans;
// Remove additive classified spans before creating classified text.
// Otherwise the text will be repeated since there are two classifications
// for the same span. Additive classifications should not change the foreground
// color, so the resulting classified text will retain the proper look.
var classifiedSpans = _excerptResult.ClassifiedSpans.WhereAsArray(
cs => !ClassificationTypeNames.AdditiveTypeNames.Contains(cs.ClassificationType));
var classifiedTexts = classifiedSpans.SelectAsArray(
cs => new ClassifiedText(cs.ClassificationType, _excerptResult.Content.ToString(cs.TextSpan)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册