Bug 493592 - word movement platform independent
Summary: word movement platform independent
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-12 19:37 EDT by Ante Smolcic CLA
Modified: 2016-05-12 19:37 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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