Skip to content

Commit

Permalink
chore: revert ime changes (#701)
Browse files Browse the repository at this point in the history
* Revert "fix: chinese IME"

This reverts commit bdc0dc1.

* Revert "fix: windows chinese ime issue (#682)"

This reverts commit 3cd5602.
  • Loading branch information
LucasXu0 authored Feb 1, 2024
1 parent e80edfc commit 8a5ca2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Future<void> onNonTextUpdate(
final selection = editorState.selection;

if (PlatformExtension.isWindows) {
if (selection != null) {
editorState.updateSelectionWithReason(
Selection.collapsed(
Position(
path: selection.start.path,
offset: nonTextUpdate.selection.start,
),
if (selection != null &&
nonTextUpdate.composing == TextRange.empty &&
nonTextUpdate.selection.isCollapsed) {
editorState.selection = Selection.collapsed(
Position(
path: selection.start.path,
offset: nonTextUpdate.selection.start,
),
);
}
Expand All @@ -31,6 +31,9 @@ Future<void> onNonTextUpdate(
offset: nonTextUpdate.selection.start,
),
),
extraInfo: {
selectionExtraInfoDoNotAttachTextService: true,
},
);
}
} else if (PlatformExtension.isMacOS) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:io';
import 'dart:math';

import 'package:appflowy_editor/appflowy_editor.dart';
Expand Down Expand Up @@ -203,7 +202,7 @@ class NonDeltaTextInputService extends TextInputService with TextInputClient {
}

// solve the issue where the Chinese IME doesn't continue deleting after the input content has been deleted.
if (Platform.isMacOS && (composingTextRange?.isCollapsed ?? false)) {
if (composingTextRange?.isCollapsed ?? false) {
composingTextRange = TextRange.empty;
}
}
Expand Down

0 comments on commit 8a5ca2a

Please sign in to comment.