Why does the Eclipse IDE horizontal scrollbar keep resetting back to the absolute left column - eclipse

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.

Related

VS Code automatic indentation

I have a problem with automatic indentation in VS Code. If you pay attention to the gif below, you will see that the editor only moves a tab forward for the first time, but the second time it should automatically detect that a tab moves forward, but this is not the case. Many editors do not have this problem, but it has really become a problem for me. Also, for example, I do not want to press a shortcut key to solve this problem, I expect the editor to handle.
I found theanswer. Just disable trimAutoWhitespace in VS Code settings.

Using vscode, i am driven crazy by annoying pop hint every time when i hit Space key, How to solve this problem?

i am driven crazy by annoying pop hint every time when I hit Space key. As shown below:
Now, how to find out which extension or pop snippet hint is causing the issue when I hit space key and which one to disable it ?
There are two ways to solve this issue.
Method 1:
In VSCODE. click File > preferences > keyboard shortcuts and search for space you could see space might be wrongly assigned to some intelli sense. Click on that particular keyboard shortcut. Double click the stroke and change the shortcut.
Method 2:
Very expensive way.
Disable all extensions first and try the space keystroke then try enabling one by one. You will definitely find the culprit.
Hope it helps
I solved it eventually by disable all snippet extend one bye one, then the latest extensions, found out the cause is https://github.com/bauhausr/antd-intellisense extension.
It drives me crazy too. I just turned off Editor: Suggest On Trigger Characters and it seems to be working for me!

How can I make the Home key put me at position 1 in Eclipse?

I'm using Eclipse Galileo, with a plugin for PHP development. I use the same editor at work and at home for my personal projects (at work, I do not use PHP or the PHP plugin, however).
One thing about using it is driving me crazy, though, and though I've spent a couple of hours digging through all the different options under Window->Preferences (as well as searching around the Internet), I can't find out how to do this one thing. Maybe someone here can help me?
Here's what's happening. I've got a line of code:
<?php
echo "Hello world"; // <-- I'm talking about this line
?>
and my cursor is on the 'w' in 'world'.
I hit the 'Home' key on my keyboard. In my key mappings, it claims this is supposed to take me to the beginning of the line ('Line Start', to be exact). To me, 'start' means 'there is nothing to the left of this position', aka position 1. As in, no tabs, no spaces, no nothing, and if I hit the 'Left arrow' key on my keyboard, I should then move to the end of the previous line. You know, how your browser works inside of a textarea, and how Word, Notepad, Excel, and almost every other program works.
Instead, when I hit 'Home', my cursor moves to position 5, the very beginning of the word 'echo'. This, in case it's not clear, is NOT the start of the line. It's the start of the non-whitespace content on the line, but that's not the way I expect this key to function. If I hit 'Home' again, I get to the REAL start of the line - position 1. Hit it again, and I'm back to 5.
It's possible that it's not a matter of the 'Home' key at all, but potentially a side-effect of the 'Smart Indenting' function. I also can't figure out how to turn that off (I've seen a few posts here that indicate that it can't be done), and it frequently messes up my formatting which causes me to waste my time fixing it, as I'm particular about how my code looks when I'm coding. For example, when I copy/paste a line, the indenting gets all messed up (the pasted line tabs in to where Eclipse thinks it should be, in spite of all of the preceding whitespace I've copied along with the text on the line). This may be related to the operation of the 'Home' key, or to Eclipse's conception of what the 'start' of the line really means.
I realize that people out there who don't code like I do will have an initial reaction of 'change the way you type', or 'ignore the messed-up formatting and let Eclipse auto-fix it later' or something similar. That's possible, but will take quite a bit of time, and is actively hindered by the fact that I'd be changing the way I work on this one app (in this one setting, as it doesn't do this at work), while all the others will continue to operate as I expect them to. So for me, that sort of suggestion is not a very viable option.
Thanks in advance for any help, advice or assistance you can offer.
PS. If you know of a way for me to keep 'Auto-indenting' on but turn off 'Smart Indenting', please let me know that too.
Untick General > Editors > Text Editors > Smart caret positioning at line start and end. Note that this will apply to all Eclipse editors, not just the PHP editor.

Gigantic Tabs in Eclipse on Ubuntu

EDIT: For anyone coming to this question through searching, you can install a Gnome Theme called Clearlooks Compact to shorten your tabs in Eclipse. This will free up a lot of screen space. You can also check out the answer below to learn how to make the tabs more horizontally compact.
Short version: How do I make a short version of Eclipse's tabs & toolbars in Ubuntu?
I've been looking around for a fix to this on Google, but to no avail. With any GTK theme, I still have this same issue and it's very, very annoying--to the point where I've stopped using Eclipse in favor of gEdit. However, after running pylint from a terminal too. many. times. I've decided I need to find a solution to this issues with Eclipse so I can have PyDev back. Here's what the tabs look like:
alt text http://c0496682.cdn.cloudfiles.rackspacecloud.com/big-tabs.png
As you can see, not only are the tabs exaggerated, but the toolbar is, too: so is the toolbar on the bottom; so are the tabs in the bottom pane. Overall, it's eating up a lot of screen space, which is a hard item to come by on a 17" screen. Any suggestions/fixes?
This can be solved changing your GTK settings;
gedit ~/.gtkrc-2.0
Then add this;
style "gtkcompact" {
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=0
GtkToolbar::space-size=0
GtkOptionMenu::indicator_size=0
GtkOptionMenu::indicator_spacing=0
GtkPaned::handle_size=4
GtkRange::trough_border=0
GtkRange::stepper_spacing=0
GtkScale::value_spacing=0
GtkScrolledWindow::scrollbar_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
}
class "GtkWidget" style "gtkcompact"
borrowed from http://ubuntuforums.org/showthread.php?t=1465712
In addition to #Varun Mehta answer, I recommend the following tips for Eclipse 4 (Juno), whose interface is partially dictated and configurable by CSS rules:
In YourEclipseDir/plugins/org.eclipse.platform_4.x.y.v2012zzzzzzzz/css, edit:
e4_basestyle.css
e4_default.css
e4_default_gtk.css
... and adjust those files. I use the following set of tweaks:
set all the margin-* and padding to 0
set swt-shadow-visible: false everywhere you find it, to get rid of those huge shadows
set .MPartStack {font-size} to something smaller than 12
Finally, remember you can disable the toolbar. In 4.0, its state wasn't remembered across sessions, but it seems like the issue is solved in 4.2.1
Bonus resources: Eclipse4/CSS will get you started on Eclipse4 CSS, E4/CSS/SWT Mapping lists other interesting CSS attributes, and CSS Spy will help you inspect the UI.
Screenshot of what I end up with:
EDIT: see also How to remove the close (×) button from Eclipse Juno tabs?
In Addition to Ronans answer, it is possible to change the height of the tabs directly in Eclipse Juno.
edit the css file of your current style (e.g. e4_default_gtk.css) and add
CTabFolder {
tab-height: 16px;
}
Note: CTabFolder ... not add this to CTabFolder Canvas!
I too have suffered from this quite a bit, before I found the solution by changing the general appearance of my IDE.
You can try and customize the look-and-feel or you Eclipse Environment from,
Go to : Window -> Preferences -> General -> Appearance.
try setting,
Current Presentation to " Default ".
Enable " Traditional Style Tabs " (for rectangular tabs.)
Disable Animation ( if you don't like swoosh effect.)
Note: the Default Eclipse 4 just got a bit better with bug 420238 closed:
[CSS] Reduce whitespace usage in the default Eclipse themes
Before:
After:
See Lars Vogel's article about it:
If you fire up the next Eclipse 4.4 milestone build, Eclipse uses much less whitespace and leaves more space for the important content.
(That would be 4.4 M5)
While this is on a technical level a trivial change, I hope that this will improve the initial perception people have in using Eclipse.
A big thanks to Daniel Rolka, Robin Stocker and Dani Megert for doing the majority of the work and a big thanks all involved parties in the Bug report to get this change accepted.
If you really want to make the tabs nice an' short, take a gander at Clearlooks Compact.
I preferred to just hit the whole IDE with a splash of "meh," so here's what I ended up with.

Can you disable automatic horizontal scrolling in Eclipse?

Sometimes when I jump into source code, e.g. from search or when looking up the declaration of something, the Eclipse text editor tries to display nearby long lines by horizontal scrolling. This happens even if the item I jumped to is well within the display without scrolling. I find this rather annoying, so:
Is there a way to disable this? I have searched in vain through all the editor settings.
Specifically, this is about Eclipse CDT, but I suppose the behaviour is the same in JDT.
This seems to happen in other eclipse editors too (like PDT for PHP)
It could have been related with the ScrolledFormText, but the Plugin Spy tells us a WorkbenchWindow class is concerned, as well as an AbstractDecoratedTextEditor, that is in essence an org.eclipse.ui.texteditor.AbstractTextEditor.
The source of that AbstractTextEditor indicates having:
a ScrollLinesAction for vertical scrolling
a TextNavigationAction for settings the cursor and potentially triggering horizontal scrolling
I am not sure how to change that behavior, except by contributing somehow to the active editor identifier (for instance, for java, "org.eclipse.jdt.ui.ClassFileEditor"), and modifying that Action.
I was having the same issue and found these open bugs for it on the Eclipse Bugs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=314208
https://bugs.eclipse.org/bugs/show_bug.cgi?id=321189
You can prevent it from happening when you switch the Code Folding off and reload the file.
grtz,
T
right click on your eclipse shortcut and choose properties. in compatibility tab choose "windows xp(servicepack 3). http://www.vistax64.com/vista-general/133849-disable-dynamic-horizontal-scrolling-vista.html