Skip to content
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

Maps with shared keys. #32

Open
Di-o-go opened this issue Jan 7, 2022 · 1 comment
Open

Maps with shared keys. #32

Di-o-go opened this issue Jan 7, 2022 · 1 comment

Comments

@Di-o-go
Copy link

Di-o-go commented Jan 7, 2022

First of all, Thank you for the great plugin. Love it!

Consider that we have the following maps:

:Arpeggio inoremap th the
:Arpeggio inoremap tha that

If I only have the first map, all works fine. Once I add the second one, there seems to be a conflict and the first map no longer works. I've seen multiple such conflicts when the maps have shared keys.

@kana
Copy link
Owner

kana commented Jan 7, 2022

Thank you for the report. As you described, such mappings (one is a subset of the other) basically doesn't work because of conflict. Internally,

  • the first one maps t and h to recognize whether two keys (t and h) are simultaneously pressed, and
  • the second one maps t, h and a to recognize whether three keys (t, h and a) are simultaneously pressed.

The point is that the second one overrides t and h, so that the example doesn't work.
(If the second one consists of two keys (like Arpeggio inoremap ta ...), it doesn't conflict with the first one.)

As a workaround, reorder mappings by lhs length. For example,

Arpeggio inoremap tha that
Arpeggio inoremap th the

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

No branches or pull requests

2 participants