hadix-lin / ideavim_extension

IdeaVIM插件的扩展插件
Apache License 2.0
291 stars 36 forks source link

Incorrect input method restoration #39

Closed denis-savran closed 4 years ago

denis-savran commented 4 years ago

Found two problems regarding input method restoration.

IdeaVim 0.54 IdeaVimExtension 1.4.0 fcitx 4.2.9.6

Input Method Configuration


Changing vi mode to insert mode by pressing i always changes the input method to ru.

Steps to reproduce:

  1. Add :set keep-english-in-normal-and-restore-in-insert to ~/.ideavimrc
  2. Change to the insert mode by pressing i. The input method is automatically changed to ru.
  3. Manually change the input method to us.
  4. Exit the insert mode.
  5. Enter the insert mode by pressing i. Input method is automatically changed to ru.

Expected behaviour: After changing to the insert mode by pressing i the input method is automatically changed to us.


Changing vi mode to insert mode by pressing o or O does not restore the input method.

Steps to reproduce:

  1. Add :set keep-english-in-normal-and-restore-in-insert to ~/.ideavimrc
  2. Change to the insert mode by pressing i. The input method is automatically changed to ru.
  3. Exit the insert mode.
  4. Change to the insert mode by pressing o. The input method is not changed and is equal to us.

Expected behavior: After changing to the insert mode by pressing o the input method is automatically changed to ru.


Plugin fcitx.vim also uses fcitx to change the input method and has the behavior described in the 'Expected behavior' sections.

denis-savran commented 4 years ago

I examined fcitx.py in fcitx.vim repository and found out the following: 1) The plugin calls deactivate (switchToEnglish) method only when the fcitx state == 2 (2 for active) and then enables inputtoggle flag. 2) The plugin calls activate (restore) method only when inputtoggle flag is enabled.

Calling fcitx-remote without any arguments returns current fcitx state.

hadix-lin commented 4 years ago

The problem of "Changing vi mode to insert mode by pressing o or O does not restore the input method." is fixed in version 1.4.1 .

The other problem will be fixed in version 1.4.2 .

Thanks for your feedback !

hadix-lin commented 4 years ago

please download the v1.4.2 , install then try it .

denis-savran commented 4 years ago

Tried it on PyCharm 2019.3.1 with a following line added to JVM options (fixes a problem of input method switching via fcitx):

-Dauto.disable.input.methods=false

Everything works perfectly. Thank you for the fix.