1

When I press the End key (in Windows) to get to the end of the line in Eclipse, I don't get to the actual end of the line if there's trailing whitespace. Instead I get to the beginning of the trailing whitespace, and subsequently pressing End causes the cursor to alternate between the end and beginning of the whitespace. Is there a way to make it always go to the end?

Reg Edit
  • 6,719
  • 1
  • 35
  • 46
H.v.M.
  • 1,348
  • 3
  • 16
  • 42

2 Answers2

4

You can turn off »Smart caret positioning at line start and end« in Preferences → General → Editors → Text Editors. Unfortunately, this seems to be only switchable for both the Home and End keys at the same time. So you'll have to decide whether you want a working End key or a smart Home key.

Personally, I need the Home key more, so I leave it as it is. I can't think of any example of a scenario where the End behavior of Eclipse could be of any use. The ways of the Eclipse devs seem to be beyond human understanding.

(Used Eclipse version: Mars.2/4.5.2)

escitalopram
  • 3,750
  • 2
  • 23
  • 24
1

Go to Window->Preferences->General->Keys and look at the settings for "Line End" and "Text End". Make sure you have the End key set only for Line End.

Mark Leiber
  • 3,118
  • 2
  • 13
  • 22
  • Didn't work. "Text End" seems to go to the end of the document, not the end of the line, and was bound to ctrl+End. The only thing that is bound to End without modifiers is "Line End". – H.v.M. May 30 '15 at 21:47
  • Eclipse comes in many forms; @Blrp, what implementation/version are you using? I tried this answer for Android Studio, which is basically Eclipse, but that doesn't have this option. I did find a related option at File/Settings/IDE Settings/Editor/Smart Keys, which includes a Home checkbox I found works to disable this behaviour at the other end of the line. – Reg Edit May 31 '15 at 08:22
  • Eclipse IDE for Java Developers / Version: Luna Service Release 2 (4.4.2) / Build id: 20150219-0600 – H.v.M. May 31 '15 at 10:27