Eclipse Macro Expansion Color - eclipse

Is there anyone who knows how to change the highlight color in the Macro Expansion popup in Eclipse CDT? The color is light grey, and it appears in Original and Fully Expanded view for those matches items.
I didn't find it in any preferences option :(
Code hover background can be changed:
Macro expansion background cannot be changed:

This color can be changed manually.
Go to Eclipse Installation Details -> Plugins tab.
Find plugin org.eclipse.cdt.ui and remember this version.
Go to eclipse installation directory and go to plugins.
Find org.eclipse.cdt.ui_VERSION.jar.
Open this file as archive and extract "org\eclipse\cdt\internal\ui\text\c\hover\CMacroCompareViewer.class".
Open file CMacroCompareViewer.class in any hex-editor.
Find sequence 11 00 D4 11 00 D4 11 00 D4
This bytecode pushes values {212,212,212} to stack before call RGB constructor. Single instruction 11 00 D4 means sipush D4. We need to change this color to more darker like {32,32,32}. So we replace value D4(212) to value 20(32), and sequence must be "11 00 20 11 00 20 11 00 20"
Copy modified file back to archive and done!

The highlight colours match your theme, so it may be that changing the hover background colour will help the clarity of the text.
Navigate through the menus:
Window, Preferences, C/C++, Editor, Appearance color options.
"Source hover background" is at the bottom of that list.
Disable 'System Default' to change the colour, or enable it to try the system default colour.
The source for my answer was here:
Eclipse, change popup text background color when hovering the mouse on a keyword

Related

how to edit stream of data in Microsoft Word

My data in MSword looks like this,"C0 00 00 FE 08 FF FB FF"
I want to add 0x and it should be comma separated ,so the final format will look like "0xC0,0x00,0x00,0xFE,0x08,0xFF".How can i make it in the required format in Microsoft Word?Currently I am doing it manually.
The simplest way to deal with it is using Find and Replace and manually replace only the first one.
Steps:
1. Select the text as shown below:
2. Press Ctrl+ H to open this window:
3. Enter Space character in "Find what" and ,0x in "Replace with".
4. Click on "Replace All" to get this:
Click "Yes" or "No" according to your preference. For this case, I clicked No.
5. Manually adjust the first one to 0xC0.
In this way, you would have to adjust the first one manually and the rest will be taken care of by Find and Replace.

Print margins stuck in Eclipse

I have print margins enabled in the text editor settings to show at 100 characters. However, it is stuck on showing at 120 characters. I have tried restarting Eclipse, enabling/disabling the setting, and setting it to multiple values. It does disappear if I disable the setting, but if it is enabled it is stuck showing at 120 characters. Any advice?
The Java code style formatter settings actually override the Print margin column value in General->Editors->Text Editors. Go to Java->Code Style->Formatter and either select New or Edit. Under the Line Wrapping tab there is an option called Maximum line width, which is the value we want to change!

Eclipse Editor Custom Color

In my Eclipse IDE Indigo Release, the color for matching brackets is not set properly, I can't see the text of the tag "<div class=...>" in the bracket, so I want to change it, there is an "Eclipse_Theme.epf" file that I imported into Eclipse to set the custom colors, I've used the following approach before to change the colors I want to replace :
[1] Take a screen shot of the Eclipse editor
[2] Paste the screen into a window's painter program
[3] Use the color picker to pick the color I want to change
[4] Find it's RGB values, e.g. 10,20,255
[5] In "Eclipse_Theme.epf" search for the RBG value and replace them with my new RGB choice, save the file
[6] Import "Eclipse_Theme.epf" into Eclipse again to replace the old one, and the new color will show up in my Eclipse editor.
But some how the above approach didn't work for the above problem, the color for matching brackets is not found in the "Eclipse_Theme.epf" file, my question is , where is it in Eclipse, that I can change this color, or which property in the "Eclipse_Theme.epf" file that represents this color, why is it not found ?!
Try Window->Preferences->Web->HTML->Editor->Syntax Coloring, or something similar, depending on the technology you use (JSF, HTML etc.). Another possibility is Window->Preferences->General->Editors->Text Editors->Annotations

How to customize Eclipse's text editor code formatting

How can I set my Eclipse's code formatter to allow code rows longer than 80 characters. I know that very long lines is hard to read but in my opinion 80 characters per line is very small value for wide screen monitors.
In Preferences, go to Java > Code Style > Formatter and edit/create the formatter and go to tab Line Wrapping. There in you can set the Maximum line width.
Further on you can in General > Editors > Text Editors also set the Print margin column which should shift up that margin (a 1px wide vertical line in the right side of your code) to the desired position. This however doesn't affect the formatter, only the human eye.
This answer was a bit old, and the path have changed with new versions of Eclipse.
To set the Maximum line width, go to Project > Properties. In the Properties window, go to Java Code Style > Formatter. Select your Active Profile (let the one which is already selected, this is the one you are currently using) and click on Edit. In the tab Line Wrapping, you can set the Maximum line width (80 by default). You can also go to the tab Comments and uncheck Enable Line Comment Formatting if you want your comments not to be formatted on multiple lines with Ctrl+Shift+F.
Don't forget to change the name of the Profile Name; if you don't change it, you won't be able to save your changes (provided the one you are editing is Built-In
Also, you can set the Print margin column in Window > Preferences > General > Editors > Text Editors.
Regarding the "small" value (80), this has just changed (in August 2014).
See "Eclipse is not a terminal anymore – Default line size of Java code formatter is now 120"
(By Lars Vogel)
Project > Properties, Java Code Style > Formatter.
Edit tab Line Wrapping
A three-years old issue is finally addressed:
bug 356851: Default line size of Java code formatter should be increased to 120
It is not mentioned in the Eclipse Project 4.5 (Mars) M1 - New and Noteworthy, but it is still "Verified for 4.5 M1 using I20140804-2000 build".

Is there an Eclipse line-width marker?

I have a specific project where I need to wrap every code line at 65 characters. I have set up the eclipse Java code formatter properly for this. But what I really want is a vertical line to be drawn in the editor showing where the max line width while I am typing, not just when I run the formmater. I know this feature is available in some capacity because it is displayed in the code formatter property page.
I don't see any option in eclipse to turn this on and I didn't see any plug-ins that do it on Eclipse Plugin Central
Look in Windows / Preferences (at least on Windows - IIRC it moves around for different operating systems) then:
General -> Editors -> Text Editors -> Show Print Margin
Tick this and it should show the line.
As a quick way of finding this, use the search filter in the top and filter on "margin".
Notes from the comments - unverified by me, but I have no reason to doubt them:
It has changed somehow in 2016: For details see [here] (https://bugs.eclipse.org/bugs/show_bug.cgi?id=495490#c2) You have to set it in the formatter: From menu [Window]-->[Preferences], select [Java]-->[Code Style]-->[Formatter], and then edit your formatter profile. In the tab page [Line wrapping], you can find a setting named "Maximum line width". Change this setting, and the print margin in Java source editor will be changed too.
In Eclipse Luna (4.4):
Choose menu Window\Preference . Look at top-left corner, in search box type filter text, type: margin.
In section Apperance color option, Choose Print margin. Choose Show print margin. In text box Print margin column , type 65 as what you want.
#Jon Skeet's answer is incomplete.
(1/2) First, do what he said:
Window --> Preferences --> General --> Editors --> Text Editors --> check the box for Show Print Margin
Ticking this box will show the vertical line.
As a quick way of finding this, use the search filter in the top and filter on "margin".
However, this only shows the line, but under most situations the "Print margin column" value there is flat-out ignored.
To set the column number for where the line should be, do what #John Percival Hackworth mentions here:
(2/2) Go to:
Window --> Preferences --> C/C++ [or whatever language you are using] --> Code Style --> Formatter --> click Edit --> under the Line Wrapping tab set the value you desire for Maximum line width.
Side note:
Use Alt + Shift + Y to toggle soft line wrapping on and off. It will soft wrap (ie: no carriage return) at the end of the screen, however, not at the column you set above.
How do you enforce hard line wrapping at the column you set above (ie: that adds a carriage return)? I don't know yet. If you figure it out let me know. In Sublime Text 3 (a much better editor but with a much worse indexer/function definition finder :() it's Alt + Q.
Update: I think it may be possible with the "CppStyle" plugin, which uses clang-format, by using Ctrl + Shift + F to apply the auto-format, but I don't know the exact instructions to make it work yet.
Related:
Set tab width: Changing editor tab width in eclipse 3.5
After some months with Espressif, but also with other brands plugged-in Eclipse, I found how to enlarge maximum line width. I made a lot of attempts and show how to do for Espressif-IDE:
Right click a project->properties->C/C++ General->Formatter
->Enable Project specific settings->
New->Give your profile a name and base it on a built-in formatter: I choose BSD/Allman->Edit this new profile->within Line Wrapping tab type for example 200 for Maximum line width->Apply changes.
Format source files: you'll have long lines.
Before I did the same manouvres starting from:
Window->Preferences->C/C++->code Style->Formatter... : that never worked.