From b015e8996d37983a7962ad1fc53883afcf39188c Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Wed, 19 Jun 2019 03:24:27 +0300 Subject: [PATCH] do not include GRAYED_SMALL_ATTRIBUTES into speed-searchable "main" text GitOrigin-RevId: 14a21b7fb3ec4d2025b7a2f5396c8ca707365a5d --- .../src/com/intellij/ide/util/treeView/NodeRenderer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java b/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java index 339415de8833..f47793dfa091 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/NodeRenderer.java @@ -9,6 +9,7 @@ import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; @@ -66,6 +67,7 @@ public class NodeRenderer extends ColoredTreeCellRenderer { } else { boolean first = true; + boolean isMain = true; for (PresentableNodeDescriptor.ColoredFragment each : coloredText) { SimpleTextAttributes simpleTextAttributes = each.getAttributes(); if (each.getAttributes().getFgColor() == null && forcedForeground != null) { @@ -81,8 +83,8 @@ public class NodeRenderer extends ColoredTreeCellRenderer { } first = false; } - // treat grayed text as non-main - boolean isMain = simpleTextAttributes != SimpleTextAttributes.GRAYED_ATTRIBUTES; + // the first grayed text (inactive foreground, regular or small) ends main speed-searchable text + isMain = isMain && !Comparing.equal(simpleTextAttributes.getFgColor(), SimpleTextAttributes.GRAYED_ATTRIBUTES.getFgColor()); append(each.getText(), simpleTextAttributes, isMain); } String location = presentation.getLocationString();