You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug 545846 - StyledText: wrong word selected on double-click
This resurrects Thomas Singer's commit cafa676, which had been
reverted in commit 29806b6.
Amend that code to not trigger if the mouse click occurs beyond the
end of the line or on a whitespace character, so in those cases, the
behavior is unchanged. Also keep the selection code the same so that
it always first finds the start, then the end of the word.
Also add tests for word selection on double click.
This resolves the problem that led to the revert: {} block selections
on double click didn't work anymore in Java and other editors. With
this modification, they do. Word selection on double click in a pure
SWT StyledText works, and double-click behavior in JFace-enhanced
StyledTexts in SourceViewers with ICharacterPairMatchers is unchanged
as far as I see.
Change-Id: I38258c001576ebb2c43caa95d0e0dc32143a2928
Also-by: Thomas Singer <[email protected]>
Signed-off-by: Thomas Wolf <[email protected]>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/183868
Tested-by: Platform Bot <[email protected]>
Reviewed-by: Mickael Istria <[email protected]>
Copy file name to clipboardExpand all lines: tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+141Lines changed: 141 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5183,6 +5183,147 @@ public void test_doubleClickWithRightMouseButtonDoesNotSelectWord() {
0 commit comments