You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Recursive mappings don't work for some two letter inputs.
To Reproduce
Add the following mappings:
map gs V
map ga gs
Expected behavior
When pressing ga, the line-wise visual selection mode should start, but nothing happens.
(ga -> gs -> V).
Confirmed that vim 9.0 works as expected.
Environment:
First discovered the bug in the following environment, but also confirmed it on a clean source build in the VimApp and developer VS2022 instance.
Visual Studio version: 2019
VsVim version: 2.8.0.0
Programming Language: C++
Check(Type 'x') any that are installed:
ReSharper
Visual Assist
Additional context
The problem seems to be caused by trying to comply with the following vim specification (:help recursive_mapping)
If the {rhs} starts with {lhs}, the first character is not mapped again (this is Vi compatible).
For example:
:map ab abcd
will execute the "a" command and insert "bcd" in the text. The "ab" in the {rhs} will not be mapped again.
Describe the bug
Recursive mappings don't work for some two letter inputs.
To Reproduce
Add the following mappings:
Expected behavior
When pressing
ga
, the line-wise visual selection mode should start, but nothing happens.(
ga
->gs
->V
).Confirmed that vim 9.0 works as expected.
Environment:
First discovered the bug in the following environment, but also confirmed it on a clean source build in the VimApp and developer VS2022 instance.
Additional context
The problem seems to be caused by trying to comply with the following vim specification (:help recursive_mapping)
It seems that we are currently checking for
{rhs} starts with the same letter than {lhs}
, rather than{rhs} starts with {lhs}
, which is causing trouble when we have two letters in lhs.https://github.com/VsVim/VsVim/blob/master/Src/VimCore/KeyMap.fs#L77-L85
I am available for drafting a PR and some tests, if that would be welcome.
The text was updated successfully, but these errors were encountered: