Skip to content

Commit

Permalink
PR updates
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosilvestre committed Oct 16, 2023
1 parent 96c5c7c commit 77754b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions super_editor/lib/src/default_editor/super_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,8 @@ final defaultImeKeyboardActions = <DocumentKeyboardAction>[
moveToLineStartWithHome,
moveToLineEndWithEnd,
doNothingWithEnterOnWeb,
enterToInsertNewTask,
enterToInsertBlockNewline,
tabToIndentListItem,
shiftTabToUnIndentListItem,
deleteToStartOfLineWithCmdBackspaceOnMac,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ class _SuperTextFieldImeInteractorState extends State<SuperTextFieldImeInteracto
// Do nothing for IME newline actions.
//
// Mac: Key presses flow, unhandled, to the OS and turn into IME selectors. We handle newlines there.
// Windows/Linux: Newlines are inserted by SuperTextField key handlers, instead of IME actions.
// Windows/Linux: Key presses flow, unhandled, to the OS and turn into text deltas. We handle newlines there.
// Android/iOS: This text field implementation is only for desktop, mobile is handled elsewhere.
break;
case TextInputAction.done:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void main() {
);
await tester.placeCaretInSuperTextField(8);

await tester.pressNumpadEnter();
await tester.pressNumpadEnterAdaptive(getter: imeClientGetter);

expect(SuperTextFieldInspector.findText().text, "this is \nsome text");
expect(SuperTextFieldInspector.findSelection(), const TextSelection.collapsed(offset: 9));
Expand Down Expand Up @@ -317,7 +317,7 @@ void main() {
);
await tester.placeCaretInSuperTextField(0);

await tester.pressNumpadEnter();
await tester.pressNumpadEnterAdaptive(getter: imeClientGetter);

expect(SuperTextFieldInspector.findText().text, "\nthis is some text");
expect(SuperTextFieldInspector.findSelection(), const TextSelection.collapsed(offset: 1));
Expand Down Expand Up @@ -348,7 +348,7 @@ void main() {
);
await tester.placeCaretInSuperTextField(17);

await tester.pressNumpadEnter();
await tester.pressNumpadEnterAdaptive(getter: imeClientGetter);

expect(SuperTextFieldInspector.findText().text, "this is some text\n");
expect(SuperTextFieldInspector.findSelection(), const TextSelection.collapsed(offset: 18));
Expand Down

0 comments on commit 77754b0

Please sign in to comment.