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

@@ -348,6 +348,9 @@ public class TextFieldTests
tf.BeginInit ();
tf.EndInit ();
Assert.False (tf.UseSameRuneTypeForWords);
Assert.Equal (22, tf.CursorPosition);
tf.NewKeyDownEvent (Key.CursorLeft.WithCtrl);
Assert.Equal (15, tf.CursorPosition);
tf.NewKeyDownEvent (Key.CursorLeft.WithCtrl);
@@ -402,14 +405,14 @@ public class TextFieldTests
new () { Position = new (idx, 1), Flags = MouseFlags.Button1DoubleClicked, View = tf }
)
);
Assert.Equal ("movie.", tf.SelectedText);
Assert.Equal ("movie", tf.SelectedText);
Assert.True (
tf.NewMouseEvent (
new () { Position = new (idx + 1, 1), Flags = MouseFlags.Button1DoubleClicked, View = tf }
)
);
Assert.Equal ("movie.", tf.SelectedText);
Assert.Equal ("movie", tf.SelectedText);
}
[Fact]

File diff suppressed because it is too large Load Diff