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.
Related
I'm looking for something that detects when a file's content does not fill the entire viewport of the editor, then adds extra space at the TOP of the file instead of at the BOTTOM.
VSCode does offer the option to add a default padding at the top of editors but it doesn't automatically display the padding when opening the file (and this isn't exactly the functionality I'm looking for either, since that would be inconvenient for larger files that take up more space than the viewport of the editor).
Bonus points if someone knows the answer to this for IntelliJ as well (if it exists) :)
How it looks now:
What I'm looking for:
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
how can I change the color of a single line in Eclipse to be able to find it fast while scrolling ? many people are suggesting to download eclipse themes but I am interested in changing the color of a single line to be able to re-find it faster
You can leave this little comment in that line:
// TODO
A small blue rectangle will be shown next to the scrollbar (the same way as your errors and warnings), and you will be able to instanlty find that line by clicking on it.
I have Eclipse 3.7.1 classic, with added Android plugin and HTML editor plugin.
If I have a long line of text in the HTML editor and scroll the horizontal scrollbar to where I want to be, when I place the cursor there and start to type, after a short pause it keeps resets the horizontal scrollbar to the far left. It doesn't do it all the time, but it is frequent enough to be annoying.
Why is Eclipse doing this, and how can I stop it?
Not really an answer but I have the same Problem since yesterday. I don't know the cause or any solution but ende up splitting all my lengthy strings using either "\" or "+". That "fixed" the problem and resulted and better readability of the code.
Good Day
Redfox
In my case this started happening after installing the Coffee Bytes Java Folding extension/plugin, and eventually it just annoyed me so much I turned it off...and the scroll jumping stopped.
It was a shame because I wanted folding of 'Regions' like in .Net and that extension gave me that ability. I've not looked for an alternative yet, but anyway I'm rambling - see if you have this extension enabled under Preferences > Java > Editor > Folding.
When this happens to me, the problem is that I'm not steady enough in my line selection. So I'll briefly be selecting two lines of input. And when the other line of input is shorter or even empty, it resets to the rightmost edge of that line (which if empty is the far left). Being very careful when moving horizontally can work but is difficult to maintain. Perhaps turning down the mouse sensitivity would help.
Searching for "eclipse line wrap" found that Alt Shift Y turns line wrap on and off. There also seems to be a button on the toolbar. See Does Eclipse have line-wrap for more details.
As others have noted, changing so that the lines aren't wider than the window also fixes this. But when you're in a situation where someone else sets the line length, toggling line wrap can be a quick and easy solution to this problem.
This of course assumes that you are having the same problem as me and not something caused by a plugin or other issue.
When I scroll to the bottom of an open document in the Eclipse editor, the last line is at the bottom of the file. This is a tad annoying when editing code at the bottom of the file / screen.
How can I enable Eclipse to scroll (much like Vim or VS) down far enough that the last line of code reaches the top of the editor window?
I'm asking for the reverse of this question, in Eclipse: How to make Visual Studio editor stop scrolling past bottom of a file?
Considering the current implementation of a Scrollbar, this is not possible.
(See org.eclipse.swt.widgets.ScrollBar.java)
At any given moment, a given scroll bar will have a single 'selection' that is considered to be its value, which is constrained to be within the range of values the scroll bar represents (that is, between its minimum and maximum values).
In the JDT (Java Editor) realm, the range is strongly linked to the number of lines a source file has.
Adding artificial "logical lines" to allows scrolling past the last line would have unintended consequences on many other parts of the JDT, related to displaying informations based on the line number of a source file (like a compilation error red underline).
This is also why there is no soft wrapping in those editors, despite
a 7-years old bug 35779 (one of the most upvoted).
Allowing word/soft wrap in the editor while typing is easy but not enough, a mapping between the model lines and the visual lines must be introduced to e.g. correctly show annotations.
It also introduces various problems that need to be solved, e.g. 'Go to Line': tools like a debugger, compiler etc. will report the model line but a user it will look strange that a different line will be selected than the one entered into the 'Go to Line' dialog
So for now, the SWT scrollbar example is still limited by the bottom of the window: