Bug 493592

Summary: word movement platform independent
Product: [Eclipse Project] Platform Reporter: Ante Smolcic <smola>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 4.5.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ante Smolcic CLA 2016-05-12 19:37:32 EDT
When moving word-forward the cursor stop at word-end, and when moving backward it stops at word-start. This difference is not useful in a programming editor. There should be an option somewhere (environment or in Preferences) to override this behaviour. I'm talking something close to Windows behaviour over GTK/Pango.

I replaced a line in the GTK version of TextLayout._getOffset() in the block that handles the SWT.MOVEMENT_WORD event:

if ((movement & SWT.MOVEMENT_WORD) != 0) {
    if (forward) {
// the next if-condition
        if (logAttr.is_word_start || (logAttr.is_word_end && !logAttr.is_white))
			
So the added condition part says "or the state is word-end and it is not a white space". It is not very weel tested but perhaps it helps.

It works fine in my Mars 4.5.1.

Regards