Skip to content

Fix Chinese pinyin input issues in the editor#319

Open
FeodorFitsner wants to merge 2 commits intoakvelon:mainfrom
flet-dev:pinyin-ime-fix
Open

Fix Chinese pinyin input issues in the editor#319
FeodorFitsner wants to merge 2 commits intoakvelon:mainfrom
flet-dev:pinyin-ime-fix

Conversation

@FeodorFitsner
Copy link

This PR fixes Chinese pinyin input issues in the editor.

Fixes #126

Root causes:

  1. composing-only updates were ignored in CodeController.value
  2. editor transforms could mutate IME in-progress composition state
  3. custom span rendering bypassed Flutter’s composing-aware rendering
  4. edit diffing could fail on transient out-of-range selections from IME

Changes:

  • Make CodeController accept composing-only updates
  • While composing is active, apply platform value updates directly
  • Use super.buildTextSpan during active composition
  • Clamp old/new selections in Code.getEditResult before diffing
  • Prevent Enter/Tab/Esc shortcut actions during active composition

Tests:

  • Added/updated tests for composing updates, IME commit path, and shortcut behavior
  • Targeted test suite passes

- preserve composing-only TextEditingValue updates

- bypass editor transforms while IME composition is active

- use Flutter composing-aware buildTextSpan during composition

- clamp selections in Code.getEditResult for transient IME ranges

- disable Enter/Tab/Esc shortcuts while composing

- add regression tests for composing updates and IME commit
- handle old composing -> new non-composing transition as direct update

- keep internal code state synced during composition updates

- preserve stable IME behavior on macOS and web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows10 Desktop] IME doesn't work well

1 participant