Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326242

Summary: [typing] Smart 'Home'/'End' key moves in wrong direction
Product: [Eclipse Project] Platform Reporter: test_test_testing
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert
Version: 3.5.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description test_test_testing CLA 2010-09-25 16:54:23 EDT
Build Identifier: M20100211-1343

In the Eclipse text editor, the Smart Home/End keys can move in the wrong direction (see Steps to reproduce) if the caret is on a line consisting entirely of tabs or spaces and the caret is not at the beginning/end of the line.

Reproducible: Always

Steps to Reproduce:
1. Create a new Untitled Text File (though any type of text file should work).
2. Indent twice (i.e. press Tab, then Tab again).
3. Move to between the two tab characters.
4. Press Home.

Result: The caret is moved to the *end* of the line if you press Home, and *beginning* of the line if you press End.
This also happens with spaces instead of tabs.
Comment 1 Dani Megert CLA 2010-09-27 02:23:44 EDT
That's the "smart" part of the action. You can disable this if you don't like it.
Comment 2 test_test_testing CLA 2010-09-27 12:16:26 EDT
I get your point, but if you press 'End', wouldn't the expected action still be to move to the end of the line, not the beginning?

(I originally noticed this for the 'End' key, but then somehow erroneously included the 'Home' key in the bug report as well - sorry about that.)
Comment 3 Dani Megert CLA 2010-09-28 02:55:06 EDT
class foo {}(In reply to comment #2)
> I get your point, but if you press 'End', wouldn't the expected action still be
> to move to the end of the line, not the beginning?
Well, it does. However, in your example you only have trailing whitespace in which case both ends actually serve as the end of "real" text.