New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supporting this pkg feature in vmp-core #1

Closed
t9md opened this Issue Mar 1, 2018 · 7 comments

Comments

Projects
None yet
2 participants
@t9md

t9md commented Mar 1, 2018

Hi, I noticed your package.
And you are using readOnly attribute, it seems to be work properly.
Thanks!

So I've supported this feature in this PR.
t9md/atom-vim-mode-plus#1040

If you have any comment and also having known BUG knowledge, please help me by sharing it!

@frapples

This comment has been minimized.

Owner

frapples commented Mar 1, 2018

Hi,In my use, I also found another bug.
Enter the punctuation Chinese input method will enter full-width characters, such as ¥%!:; (I do not know if Japanese input method has this problem)

When in normal mode, when you press a symbolic key such as :, the character sequence received by the atom is a full-width character . This caused the symbol key to be invalid.

There are two solutions, one is to configure the input method to enter half-width characters. Another way to map these full-width characters is valid after my test:

'atom-text-editor.vim-mode-plus:not(.insert-mode)':
  '¥': 'vim-mode-plus:move-to-last-character-of-line'
  '': 'vim-mode-plus:search'
  '': 'ex-mode:open'
#  .... ....

A better way is to map : to , similar to the vim nmap command. But I do not know how to do it at atom.

@t9md

This comment has been minimized.

t9md commented Mar 2, 2018

Let me check my understanding, are you saying

  • With this pkg enabled
  • IME enabled in insert-mode then escape to normal-mode
  • You can use most of commands such as j, k thanks to auto-disabled-IME behavior of this pkg.
  • But you still see that IME is NOT COMPLETELY DISABLED for some character such as : .

Does my understanding correct?

@frapples

This comment has been minimized.

Owner

frapples commented Mar 2, 2018

Completely correct. I'm sorry for my poor English, I wrote with Google translate.

The reason for this bug is that when you type : Chinese IME will convert it to .
There are many such conversions in Chinese input method:

  1. $ => ¥
  2. ( =>
  3. ) =>
  4. : =>
  5. So on.....

There are two solutions:

  1. Chinese IME can be configured to turn off this conversion.
  2. Configure atom keymap, similar nmap ¥ $
@t9md

This comment has been minimized.

t9md commented Mar 2, 2018

Me too learning english!

Chinese IME can be configured to turn off this conversion.

That's sound good.
Thanks now I think I clearly understand your situation.
From my understanding, this is the limitation rather than bug.

It's depend of how independent IME react for the input.readOnly attribute.
But this might be minor BUG of Chinese IME.
What's the situation that user want to type multi-byte character into input.readOnly = true input form?

Anyway config param name autoDisableInputMethodWhenLeavingInsertMode is not correct.
Since it does not actually disable IME.
To make it perfectly correct, I should name it setReadOnlyAttributeToHiddenInputElementWhenLeavingInsertMode. 😄

@frapples

This comment has been minimized.

Owner

frapples commented Mar 2, 2018

What's the situation that user want to type multi-byte character into input.readOnly = true input form?

In fact,when I type ( ANYWHERE,Chinese IME will convert it to . This is because punctuation in Chinese writing uses multi-byte character. is multi-byte character.
Therefore,nothing happens when typing multi-byte character in normal mode.

Just now, I carefully tested and observed this problem. I found that this problem only appeared in some Chinese IME. In Microsoft IME (Windows) and RIME (linux, osx), it works well.

I suggest writing this to FAQ. In some Chinese IME, non-alphanumeric keys may not work.The solution is to make sure punctuation entered by IME is ANSI character.

I am very happy for this patch to be merged into vmp, thank you!

@t9md

This comment has been minimized.

t9md commented Mar 2, 2018

What's the situation that user want to type multi-byte character into input.readOnly = true input form?
In fact,when I type ( ANYWHERE,Chinese IME will convert it to ( . This is because punctuation in Chinese writing uses multi-byte character. ( is multi-byte character.
Therefore,nothing happens when typing multi-byte characあter in normal mode.

In Japanese IME, we too have both ascii ( and multibyte .
And we use same key. Which character is inserted is determined based on IME state.
I understand this is same as your Chinese IME.

What I wanted to say is I can not find any benefit to type multibyte version of punctuation when input.readOnly = false.
It's obviously does no good since non-ascii char will just be ignored.
I'm not saying vmp specific topic.
Isn't it normal behavior of input element when it's readOnly attribute set to false, is it?.

Thus, it seems for me the behavior you reported is JUST MINER BUG of that IME. Don't you think so?

@t9md

This comment has been minimized.

t9md commented Mar 2, 2018

Now released vmp v1.30.0.
And I added some limitation note and link to this discussion in FAQ section of README.md.

Thank you for your idea and also sharing your experience for limitation of this feature!!

@t9md t9md closed this Mar 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment