How to change link link color in Search View in Eclipse CDT?

I want to change the highlight color of links displayed in Eclipse Search View after CDT finds the link (right click on the code β†’ Links β†’ any). How can i do this?

Note: this is different from the standard matching backlight color .

Illustration: enter image description here

+5
source share
2 answers

I found two simple solutions to this problem:

1) Create a new file and add the following lines:

file_export_version=3.0 /instance/org.eclipse.ui.workbench/org.eclipse.cdt.ui.ColoredLabels.match_highlight=128,0,128 

You can change the color value to suit your theme.

Then go to File β†’ Import β†’ Settings

Browse to the newly created file and click Finish.

2) Go to [workspace-location] /. metadata / .plugins / org.eclipse.core.runtime / .settings

Modify the org.eclipse.ui.workbench.prefs file and add the line

 org.eclipse.cdt.ui.ColoredLabels.match_highlight=128,0,128 
+10
source

It seems that these colors are not editable and therefore hardcoded in such a way that (clearly!) Does not work well with a dark theme.

This is the important part from org.eclipse.cdt.ui / plugin.xml :

  <colorDefinition id="org.eclipse.cdt.ui.ColoredLabels.match_highlight" isEditable="false" label="%Dummy.label" value="206, 204, 247"> </colorDefinition> 

A small change in the plugin.xml file allows you to change the color:

  <colorDefinition categoryId="org.eclipse.cdt.ui.presentation" id="org.eclipse.cdt.ui.ColoredLabels.match_highlight" isEditable="true" label="Match Highlight" value="206, 204, 247"> </colorDefinition> 

And then you can edit the background color and fix your problem.

This is a known issue in the CDT ( bug 468206 ), contributions are welcome.

+2
source

Source: https://habr.com/ru/post/1236178/


All Articles