Fixes #4112. WordForward and WordBackward are not consistent with identical RuneType (#4131)

* Move parallelizable to new file

* Add UseSameRuneTypeForWords property

* Add SelectWordOnlyOnDoubleClick property and ProcessDoubleClickSelection method

* Change IsSameRuneType method to also handle equivalent rune types

* Fix WordBackward and WordForward to support properly handle rune types

* Fix unit test to deal properly with the new roles of rune types

* Add new unit tests

* Remove duplicated unit test

* Add UseSameRuneTypeForWords and SelectWordOnlyOnDoubleClick handling into Editor scenario
This commit is contained in:
BDisp
2025-06-09 21:29:45 +01:00
committed by GitHub
parent b59ac3b69c
commit e1086a45a9
8 changed files with 2777 additions and 2239 deletions

View File

@@ -607,6 +607,8 @@ public class TextFieldTests (ITestOutputHelper output)
Assert.True (tf.NewKeyDownEvent (Key.CursorRight.WithShift.WithCtrl));
#endif
Assert.Equal ("is is a test.", tf.Text);
Assert.Equal ("is a test", tf.SelectedText);
Assert.True (tf.NewKeyDownEvent (Key.CursorRight.WithShift.WithCtrl));
Assert.Equal ("is a test.", tf.SelectedText);
Assert.Equal (13, tf.CursorPosition);
Assert.True (tf.NewKeyDownEvent (Key.CursorLeft));
@@ -1340,6 +1342,13 @@ public class TextFieldTests (ITestOutputHelper output)
break;
case 5:
Assert.Equal (31, _textField.CursorPosition);
Assert.Equal (-1, _textField.SelectedStart);
Assert.Equal (0, _textField.SelectedLength);
Assert.Null (_textField.SelectedText);
break;
case 6:
Assert.Equal (32, _textField.CursorPosition);
Assert.Equal (-1, _textField.SelectedStart);
Assert.Equal (0, _textField.SelectedLength);
@@ -1501,6 +1510,13 @@ public class TextFieldTests (ITestOutputHelper output)
break;
case 5:
Assert.Equal (31, _textField.CursorPosition);
Assert.Equal (0, _textField.SelectedStart);
Assert.Equal (31, _textField.SelectedLength);
Assert.Equal ("TAB to jump between text fields", _textField.SelectedText);
break;
case 6:
Assert.Equal (32, _textField.CursorPosition);
Assert.Equal (0, _textField.SelectedStart);
Assert.Equal (32, _textField.SelectedLength);
@@ -1550,6 +1566,13 @@ public class TextFieldTests (ITestOutputHelper output)
break;
case 3:
Assert.Equal (31, _textField.CursorPosition);
Assert.Equal (10, _textField.SelectedStart);
Assert.Equal (21, _textField.SelectedLength);
Assert.Equal ("p between text fields", _textField.SelectedText);
break;
case 4:
Assert.Equal (32, _textField.CursorPosition);
Assert.Equal (10, _textField.SelectedStart);
Assert.Equal (22, _textField.SelectedLength);

File diff suppressed because it is too large Load Diff