Update raw_editor.dart

pull/1378/head
liam-duan 2 years ago committed by GitHub
parent 787c7a845f
commit 0d11ca306a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      lib/src/widgets/raw_editor.dart

@ -722,6 +722,7 @@ class RawEditorState extends EditorState
}
KeyEventResult _handleSpaceKey(RawKeyEvent event) {
try {
final child =
controller.document.queryChild(controller.selection.baseOffset);
if (child.node == null) {
@ -733,6 +734,10 @@ class RawEditorState extends EditorState
return KeyEventResult.ignored;
}
if (line.first == null) {
return KeyEventResult.ignored;
}
final text = castOrNull<leaf.Text>(line.first);
if (text == null) {
return KeyEventResult.ignored;
@ -748,8 +753,11 @@ class RawEditorState extends EditorState
} else {
return KeyEventResult.ignored;
}
} catch (e) {
print("Caught exception: $e");
}
return KeyEventResult.handled;
return KeyEventResult.ignored;
}
KeyEventResult _handleTabKey(RawKeyEvent event) {

Loading…
Cancel
Save