I want to change the highlight color of references showing in Eclipse's Search View after CDT find reference operation (right click on code -> References -> any). How can I do this?
Note: this is different from standard match highlight color.
Illustration:
I found out two easy solutions to this problem:
1) Create a new file and add those lines (extension of the file needs to be .epf):
file_export_version=3.0
/instance/org.eclipse.ui.workbench/org.eclipse.cdt.ui.ColoredLabels.match_highlight=128,0,128
You might change the color value to match your theme
Then go to File -> Import -> General -> Preferences
Browse to the newly created file and click the Finish button
2) Go to [workspace-location]/.metadata/.plugins/org.eclipse.core.runtime/.settings
Edit org.eclipse.ui.workbench.prefs file and add the line
org.eclipse.cdt.ui.ColoredLabels.match_highlight=128,0,128
It seems that these colours are not editable and are therefore hard coded in a way that (clearly!) does not work well with a dark theme.
This is the relevant part from the 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 to the plugin.xml allows the colour to be editable:
<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 colour and fix your problem.
This is a known issue in CDT (Bug 468206), contributions welcome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With