Skip to content

Commit

Permalink
chore: formatting arrow keys test
Browse files Browse the repository at this point in the history
  • Loading branch information
MayurSMahajan committed Apr 21, 2023
1 parent 54c6ac1 commit 01a3d7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ShortcutEventHandler cursorLeftWordDelete = (editorState, event) {

final textNode = textNodes.first;

//we store the position of the index where the current word ends.
//we store the position where the current word starts.
var startOfWord =
selection.end.goLeft(editorState, selectionRange: SelectionRange.word);

Expand All @@ -26,7 +26,7 @@ ShortcutEventHandler cursorLeftWordDelete = (editorState, event) {
.substring(startOfWord.offset, selection.end.offset);

//if it is whitespace then we have to update the selection to include
//the left word of the whitespace.
//the left word from the whitespace.
if (selectedWord.trim().isEmpty) {
//make a new selection from the left of the whitespace.
final newSelection = Selection.single(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ void main() async {
..insertTextNode("Welcome to AppFlowy");
await editor.startTesting();

await editor.updateSelection(Selection.single(path: [1], startOffset: 19));
await editor.updateSelection(
Selection.single(path: [1], startOffset: 19),
);

await editor.pressLogicKey(key: LogicalKeyboardKey.arrowUp);

Expand Down Expand Up @@ -90,7 +92,9 @@ void main() async {
);
}

await editor.updateSelection(Selection.single(path: [1], startOffset: 7));
await editor.updateSelection(
Selection.single(path: [1], startOffset: 7),
);

await select(true);

Expand Down Expand Up @@ -686,7 +690,6 @@ void main() async {
),
);
});

}

Future<void> _testPressArrowKeyInNotCollapsedSelection(
Expand Down

0 comments on commit 01a3d7b

Please sign in to comment.