Community
Participate
Working Groups
Created attachment 253736 [details] C/C++ Search match background color issue I'm running dark theme and I've a problem with background color for search match in C/C++ search window (see attached screenshot). Match background color can be adjusted in: Preferences > General > Appearance > Color and Fonts > Match highlight background color. This option works for regular "File Search", but for "C/C++ Search" this color hardcoded (RGB:206,204,247). Unreadable when text font is white. Issue exist in Luna SR2 and Mars RC1. Both Windows & Linux.
Someone on SO ran into this, while investigating I tried out a quick fix solution as I am not very familiar with themes, but in the absence of inheriting the colours fully so they work in the dark theme, simply making them editable may be a short term workaround: http://stackoverflow.com/questions/33765133/how-to-change-highlight-color-of-references-in-search-view-in-eclipse-cdt/33765612#33765612
Extra notes (for me or anyone else who comes to fix this), the colour is eventually used in org.eclipse.cdt.internal.ui.search.CSearchLabelProvider.getStyledText(Object) and the style is created here org.eclipse.cdt.internal.ui.viewsupport.ColoringLabelProvider.HIGHLIGHT_STYLE
GARCIN David on SO provided a useful workaround for this issue (http://stackoverflow.com/a/34996869/2796832), reproduced here: I found out two easy solutions to this problem: 1) Create a new file and add those lines: 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 -> Preferences Browse to the newly created file and clic 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
I just wanted to give the Dark Theme a new try with Eclipse Neon. However, the problem described here still exists so Dark Theme is - for me - not usable with CDT.
(In reply to Jonah Graham from comment #3) > GARCIN David on SO provided a useful workaround for this issue > (http://stackoverflow.com/a/34996869/2796832), reproduced here: > > > I found out two easy solutions to this problem: > > 1) Create a new file and add those lines: > > 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 -> Preferences > > Browse to the newly created file and clic 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 This doesn't work for me. I'm running Eclipse Neon 4.6.3 (CDT 9.2.1.201704050430), should the workaround be applicable to that version too?
It works for me with latest CDT. Just added two lines to org.eclipse.ui.workbench.prefs: org.eclipse.cdt.ui.ColoredLabels.match_highlight=128,0,128 org.eclipse.cdt.ui.ColoredLabels.writeaccess_highlight=128,0,64
@Rasmus Pedersen I have Neon and this a non-issue for me because you can fix it like so: Windows > Preferences > General > Appearance > Colors and Fonts > Colored labels - match highlight ... I found it here: https://stackoverflow.com/questions/10922934/how-to-change-search-background-color-in-eclipse/10955355 Hope this helps
@Viorel Florian, Are you speaking of the search background color or general match background color? Does one translate to the other now (I don't know, I haven't tested)? See differences between these issues here. Unrelated issue: https://stackoverflow.com/questions/18635149/changing-highlighting-color-in-a-theme-from-eclipse-color-theme Current issue: https://stackoverflow.com/questions/33765133/how-to-change-highlight-color-of-references-in-search-view-in-eclipse-cdt
I confirm that Viorel's comment is for the match in the editor, not the search panel. This issue is still relevant. Oxygen and CDT 9.4.3.
Just tried all the workaround listed and none work for me :(
Found a workaround that works for me. With eclipse closed: - unpack <eclipse installation folder>\plugins\org.eclipse.cdt.ui_6.3.0.201802261533.jar - edit plugin.xml and change the color to your taste - put this file back into the jar - delete <eclipse installation folder>\configuration\org.eclipse.core.runtime\.mainData.1 - start eclipse
(In reply to Geobert Quach from comment #11) > > Found a workaround that works for me. With eclipse closed: > > - unpack <eclipse installation > folder>\plugins\org.eclipse.cdt.ui_6.3.0.201802261533.jar > - edit plugin.xml and change the color to your taste > - put this file back into the jar > - delete <eclipse installation > folder>\configuration\org.eclipse.core.runtime\.mainData.1 > - start eclipse I confirm that this is last effective solution for eclipse-cpp-2018-09-win32-x86_64.zip(org.eclipse.cdt.ui_6.3.1.201811180605.jar). Import preferences file (from https://stackoverflow.com/questions/33765133/how-to-change-highlight-color-of-references-in-search-view-in-eclipse-cdt) only work the first time import and brfore restart eclipse. Once eclipse restarted, `org.eclipse.cdt.ui.ColoredLabels.match_highlight=128,0,128` is exist in org.eclipse.ui.workbench.prefs, and that color will become (RGB:206,204,247) again ignoring content in org.eclipse.ui.workbench.prefs. But after I edit plugin.xml in org.eclipse.cdt.ui_6.3.1.201811180605.jar and delete configuration\org.eclipse.core.runtime\, IT WORKS! NOTE: Import preferences file still works for eclipse-cpp-oxygen-3a-win32-x86_64.zip(org.eclipse.cdt.ui_6.3.0.201802261533.jar) to me.
upgraded from cpp-oxygen to cpp-2018-12 and none of the workarounds are working for me anymore. On Linux or MacOS. I have the C/C++ version installed but can find the CDT plug-in jar, so I can't try that one. ~/eclipse/cpp-2018-12$ find . -name "*plugins*" ./Eclipse.app/Contents/Eclipse/plugins MacOS ~/eclipse/cpp-2018-12/Eclipse.app/Contents/Eclipse/plugins$ ls -al total 112 drwxr-xr-x 3 user 600 96 Feb 12 19:37 . drwxr-xr-x 9 user 600 288 Feb 12 19:19 .. -rw-r--r-- 1 user 600 54580 Feb 12 17:37 org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar Linux: ~/eclipse$ find . -name "*plugins*" ./plugins ~/eclipse$ ls -al plugins/ total 64 drwxr-xr-x 2 user staff 4096 Feb 12 17:14 . drwxr-xr-x 6 user staff 4096 Feb 12 20:17 .. -rw-r--r-- 1 user staff 54580 Feb 12 17:14 org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar
Created attachment 277548 [details] 2018-12
New Gerrit change created: https://git.eclipse.org/r/139784
New Gerrit change created: https://git.eclipse.org/r/139982
Gerrit change https://git.eclipse.org/r/139784 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=e93ea0ab70b2e487ef55e5886ccac9dd93bce84b
The two fixes together give the users the best experience here. So I don't know who to assign to. Thanks to both Marco and Tomasz for providing fixes. To summarize, Marco exposes the search colours in the preferences UI, and Tomasz changes the default to be the same as the platform's search result.
Yep, however I'd like to keep the write access feature, using the same color and without any UI will loose this feature.
(In reply to Marco Stornelli from comment #19) > Yep, however I'd like to keep the write access feature, using the same color > and without any UI will loose this feature. Marco, I have approved and merged your fix for adding these colours to the UI. Regardless of anything else that means going forward users will be able to customize. I am now trying to understand if we can achieve sensible defaults for both normal and write access having different colours.
I have looked into how to do this properly with themeing. As a result I will take Marco's patch (https://git.eclipse.org/r/#/c/139784/) so that user's can fine tune these colours, but for the defaults I will try to use themeing as not to lose out on having different defaults for "Match background highlight" and "Write match background highlight"
Gerrit change https://git.eclipse.org/r/139982 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=5131b86d9a1d56141ed7d884a656335fb60b271d
Turns out that themeing does not work for this. I examined whether JDT supported this to learn from them, but unfortunately JDT has basically the same bug (see Bug 546210). Hopefully someone can solve this problem here on in JDT and the fix be copied across to the other one. In the meantime I have set the non-write highlight to the same as normal highlight from org.eclipse.ui.search, this is what JDT does and what Tomasz provided, so I have accepted his patch for the main highlight change, but not the write highlight.
For those who are waiting for next release - as a temporary workaround you can just edit file: plugins/org.eclipse.ui.themes_1.2.400.v20190223-1254/css/dark/e4-dark_preferencestyle.css and add those two lines before last closing brace: 'org.eclipse.cdt.ui.ColoredLabels.match_highlight=206,92,0' 'org.eclipse.cdt.ui.ColoredLabels.writeaccess_highlight=128,0,128' BTW - what is the difference between write highlights and normal ones?
(In reply to Tomasz Rojek from comment #24) > For those who are waiting for next release - as a temporary workaround you > can just edit file: > plugins/org.eclipse.ui.themes_1.2.400.v20190223-1254/css/dark/e4- > dark_preferencestyle.css > > and add those two lines before last closing brace: > 'org.eclipse.cdt.ui.ColoredLabels.match_highlight=206,92,0' > 'org.eclipse.cdt.ui.ColoredLabels.writeaccess_highlight=128,0,128' Tomasz, thanks for this. Have you tried this in a dev environment. I had tried that approach, but it didn't work. If it does work, can you submit a patch with that change? > BTW - what is the difference between write highlights and normal ones? If the identifier is a variable and being assigned, then the write highlight is used.
@Jonah Do we need to close this bug as fixed? Or is it better to keep it open until bug 537988 is closed?
(In reply to Marco Stornelli from comment #26) > @Jonah Do we need to close this bug as fixed? Or is it better to keep it > open until bug 537988 is closed? I think we should either create a new bug to track the remaining issue (default colour in dark theme for highlight of write occurrences) or just leave this one open. However it is assigned to you, so please decide what you prefer.
In the bottom line - what should be done for the solution from http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/ ? What is needed to be done after downloading the .zip? should it be copied somewhere? Please help
(In reply to Amitai Weil from comment #28) > In the bottom line - what should be done > for the solution from > http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/ ? > > What is needed to be done after downloading the .zip? > should it be copied somewhere? > Please help Hi Amatai, The workaround is described in Comment 24. The workaround does not require you to download anything, simply edit a file in your Eclipse installation you already have. Use the Git repository is if you are able to develop and test a fix so that the workaround isn't needed. The next version of CDT (9.8.0) will be significantly improved, but there is still one of the search colours that has a bad default.
(In reply to Tomasz Rojek from comment #24) > For those who are waiting for next release - as a temporary workaround you > can just edit file: > plugins/org.eclipse.ui.themes_1.2.400.v20190223-1254/css/dark/e4- > dark_preferencestyle.css > > and add those two lines before last closing brace: > 'org.eclipse.cdt.ui.ColoredLabels.match_highlight=206,92,0' > 'org.eclipse.cdt.ui.ColoredLabels.writeaccess_highlight=128,0,128' > > BTW - what is the difference between write highlights and normal ones? I have no such file in my workspace (under [workspaceName]\.metadata\.plugins\ Searching all folder mentioned didn't show any appropriate result of 'themes'/'dark' or any *.css file. My this be because I'm using the Code Composer studio software? (Texas Instruments MCU IDE).
Created attachment 278328 [details] CCS CDT 9.2
(In reply to Amitai Weil from comment #31) > Created attachment 278328 [details] > CCS CDT 9.2 After some search I've found the file, which appeared (for CCS 9) in: C:\TI\ccs900\ccs\eclipse\plugins\org.eclipse.ui.themes_1.2.100.v20180514-1547\css\dark None the less - the editing of file still didn't change the color, as appears in the figure, maybe there's some configuration overriding these dark setting?
After playing with some settings (don't remember all) and rechosing dark Linux theme all is OK new, thanks
New bug report bug 546610 opened.