do not include GRAYED_SMALL_ATTRIBUTES into speed-searchable "main" text

GitOrigin-RevId: 14a21b7fb3ec4d2025b7a2f5396c8ca707365a5d
This commit is contained in:
Gregory.Shrago
2019-07-02 06:52:16 +03:00
committed by intellij-monorepo-bot
parent b5163879d5
commit b015e8996d
@@ -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();