Eclipse 4.6.1
CentOS 7
Got a large project with Java and Python files.
There is something about the way I type that leaves blank lines composed of left trailing white spaces before a return.
When I push my code up to Gerrit these show up as angry red rectangles.
I found settings to clean up ALL such left trailing white space upon saving, but I can't really use it, as I often edit existing files that also have such left trailing white spaces in it. If those get cleaned out to, more lines than those actually altered show in the Gerrit code diff, getting everyone confused.
I've had luck REDUCING this problem by having Eclipse display the special characters. However, I still miss many because those special character displays aren't very visually promiment --- not like those angry red bars in the Gerrit code diff.
Is there some way I can get the left trailing white spaces in Eclipse to be displayed in a more graphically prominent way? Is there a way to preview my files in Gerrit without them counting as a patch set?
Best way to deal with this is to use a pre-commit hook that will removing trailing whitespaces and expand tabs in the changed code. We use this one: https://gist.github.com/mokagio/0fbf7d475c9326e30edd
Related
I am currently setting up VS Code on a new computer and want to maintain all the same configuration, addons etc that I had on my previous computer. I was able to copy all of the settings, fonts, themes I like, etc; however for some reason I can't figure out how to change the size of the Tab arrow character for whitespace.
In my old editor, the Tab arrow spanned two spaces, whereas on my new computer, the tab arrow only spans one space.
I've been looking all over, and tried googling any variation of "change tab character size", "modify tab arrow span" etc that I could think of. I seem to remember changing the arrow size at some years ago, which is how I got it in my old editor, but I've totally forgotten, and can't find the setting anywhere, neither searching in the VS Code settings, nor on google like I mentioned; the only things that turn up are for changing tab indent size from 2, to 4 spaces etc.
Here are some screenshots of what I mean, from the new VS Code editor and from the one on my older computer:
Current tab arrow size in VS Code:
Old tab arrows size (what I want in my new editor):
This is driving me crazy, and I'm sure it's a simple setting somewhere that I'm missing. Any help would be appreciated!
Edit: In case it is relevant, I'm using JetBrains Mono as my font, and its the same version of the font as from my old computer as well, I copied it over and installed it on the new PC.
To my shock, the issue resolved itself after rebooting my PC. Once again it would seem that the tried and true "have you tried turning it off and on again" continues to ring true in many cases.
The only explanation I can think of is that perhaps some of the font symbols for whitespace characters weren't fully updated for some reason after installing the JetBrains Mono font, which I had installed earlier the same day, and after rebooting my PC I guess all the characters were fully updated/refreshed, and now the longer arrow is displayed for the tabs; I guess this also means that there is no arrow resizing per se, and the arrow symbol for the tab is simply the font symbol.
In any case, I figured I should write this update as an answer in case something like this happens to anyone else in the future.
Attached is the picture where the leading spaces are visible higlighted with red color. How to avoid displaying these whitespaces ? I have tried delete whitespaces extension. On saving the file they again come back.
What you see is changes since the last commit if your code is under version control system like git. Probably when you save your file auto code formatter restore this space according to your code format settings. You can try to disable "Format on save" option in VSCode settings.
We are using git. I am using eclipse. Some of the committers may not be using eclipse. Here's what is happening.
I make a small change in an existing file (properties/xml/java) and save it and commit it.
gitk (without ignore space change) and eclipse thinks the whole file changed. The commit shows ## -1,354 +1,354 ## which means the entire file changed.
When I check for code change difference, with ignore white space, then I can see the text difference. But I don't know what white space change is causing this.
How do I detect what white space difference is there between two files? It could be new line character, carriage return, tab, or something else.
This is how eclipse compare editor works. Unlike other file compare tools(kdiff3 or winmerge or Beyond compare) it shows entire file instead of showing only the difference.
But you can jump to individual changes by clicking on the change book markers as highlighted below.
You can integrate other compare tools(Ex: Beyond compare, winmerge) in eclipse.
Refer these links
Beyond Compare with git
Winmerge with git
Edit:
White space changes are shown in GREY background color
Does anyone know how to get rid of the superfluous white space at the top of a split editor pane in the latest version of eclipse (I think it's been around since Indigo actually). To me it looks like the minimise and maximise buttons have been misplaced, see image below.
I know editor planes can be split in a different way, but that is a problem when I switch perspectives, or open new files (they always open in the original editor pane).
I know it is a minor thing, but wasted real estate on my screen annoys me.
Thanks,
Stephen
I've dealt with this on numerous occasions and still occurs on Juno.
If you open two files in the order: ITest.java, Test.java and drag the second/rightmost file (Test.java) to create the split the whitepace will be created (as your picture). The fix is to drag the first/leftmost file (ITest.java) to create the split and then the whitespace is not created.
is there any plugin for eclipse to add some space below the code so that I can scroll the last line up to half the screen / up to the top? I hate it when the line I am writing on is always on the bottom of my screen.
Of course, I could add these lines myself, but that would also mean that I have to remove them later, and I don't feel comfortable with so many empty lines...
If there is no such plugin, would it be easy to write one?
I suggest as you are saying adding these lines manually and in the end hit Ctrl+Shift+F to format your code which also includes removing those empty lines at the bottom.