akvelon / flutter-code-editor

Flutter Code Editor is a multi-platform code editor supporting syntax highlighting, code blocks folding, autocompletion, read-only code blocks, hiding specific code blocks, themes, and more.
https://akvelon.com
Apache License 2.0
185 stars 45 forks source link

[Windows10 Desktop] IME doesn't work well #126

Open CorvusYe opened 1 year ago

CorvusYe commented 1 year ago

IME: Microsoft [MSPY]. flutter_code_editor verson: 0.1.13

When type something in IME Chinese mode, unexpectation happened https://user-images.githubusercontent.com/15630211/207526300-570bb3f2-cc78-4870-aa30-a3ab43d7011f.mp4

alexeyinkin commented 1 year ago

@CorvusYe thanks for the report.

Can you please:

  1. Verify this with the most recent version which is currently 0.2.1.
  2. Provide the minimal reproducible example.
  3. Give the exact steps like "click after ... symbol, type ..., press ..."
CorvusYe commented 1 year ago

version: 1.0.0+1

environment: sdk: '>=2.19.0-306.0.dev <3.0.0'

dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 flutter_code_editor: ^0.2.1

dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.0 uses-material-design: true



- Then copy the `Basic Usage` into main.dart from https://pub.flutter-io.cn/packages/flutter_code_editor
- steps:
    1. Type "test" in English mode is no problem.
    2. Switch the IME mode to Chinese
    3. Type "Ver ...",  reproducible.

https://user-images.githubusercontent.com/15630211/207621156-42f7b841-c2b9-458e-9015-f18b84187f6a.mp4
CorvusYe commented 1 year ago

I am not sure whether it is the upstream issue or current repo. I will push the example to https://github.com/CorvusYe/issues_demo.git when my network is well.

Thanks for your reply.

alexeyinkin commented 1 year ago

Thanks for the report and the example. We currently have other priorities preparing this editor for a use in a large project. We may work on this later.

hsduren commented 2 months ago

I I encountered the same issue

T2XX commented 2 months ago

It will have problems when non English users use the Windows like input method, because the Windows like input method first inputs user text and then replaces the original text. Obviously, the state management component of this library did not consider this during code design, resulting in the state manager adding data before user input to the history stack and treating the text in the replacement operation as new input text when the system is ready to replace it. To solve this, I think it is necessary to check the text state management component