From d7410cd6e89c0b748a7b98b569b2f119b45acc31 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Wed, 4 Jan 2023 20:10:41 +0800 Subject: [PATCH] feat: #1624 add shortcut for Shift + Option + Left/Right Arrow --- .../arrow_keys_handler.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/arrow_keys_handler.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/arrow_keys_handler.dart index 417c4ff99c..c296c773bb 100644 --- a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/arrow_keys_handler.dart +++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/arrow_keys_handler.dart @@ -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; }