feat: #1624 add shortcut for Shift + Option + Left/Right Arrow

This commit is contained in:
Lucas.Xu 2023-01-04 20:10:41 +08:00
parent 06c5f6a790
commit d7410cd6e8

View File

@ -392,18 +392,15 @@ extension on Position {
case _SelectionRange.character:
if (node is TextNode) {
return Position(
path: path, offset: node.delta.nextRunePosition(offset));
path: path,
offset: node.delta.nextRunePosition(offset),
);
} else {
return Position(path: path, offset: offset);
}
case _SelectionRange.word:
if (node is TextNode) {
final result = node.selectable?.getWordBoundaryInPosition(
Position(
path: path,
offset: node.delta.nextRunePosition(offset),
),
);
final result = node.selectable?.getWordBoundaryInPosition(this);
if (result != null) {
return result.end;
}