Conversation
masad-frost
left a comment
There was a problem hiding this comment.
Nice. Thanks a lot for the fix.
It seems that it may have broken about 28 tests, and likely caused real issues. Do you have access to the test results?
You can also run them locally
Yeah, I saw the CI fail after I submitted the PR. I got as far as running the tests locally and seeing the same thing and am intending to look into it but haven't got to it yet. I should get a chance today. |
|
My observation when I tried the tests the other day and again now is that manually replicating the failing tests (the five I've tried, at least) in the |
|
Ah interesting. If you don't get to the bottom of it I can jump in sometime next week. Or maybe @nightwing can take a look if he's got some time. |
|
Bumping this one for @nightwing as well. |
|
The tests are failing because codemirror captures the esc key when it waits for autocompletion results to be gathered, even though the popup itself is not shown. It is usually impossible to replicate manually because default completers are resolved very quickly |
|
As discussed in the linked pull request, overriding other keymaps seems to be required to correctly emulate vim. If there are other issue reports we may reopen this and try to find a workaround for autocomplete, but for now closing this pull request. |
This PR changes the key handling to use a keymap with a single keybinding with the any method, which is new in
@codemirror/view6.3.0.This means that rather than the current situation where the Vim key handler runs before any CM6 keymap, the Vim key handler is a regular keymap and participates in the precedence hierarchy with other keymaps. I'm not aware of any current issues this will fix but it makes it possible to override Vim keybindings with a higher-precedence keymap, which was not possible before and is a definite improvement.
I've done some testing and haven't spotted any problems with the default set-up. However, this has the potential to break existing installations with other keymaps, because a keymap that currently always only runs after the Vim key handler may now have higher precedence and run before it instead, so I think there should probably be a note in the README and possibly a minor version number bump.
Background: https://discuss.codemirror.net/t/autocompletion-keymap-precedence-again/4827
Equivalent Emacs keybindings PR: replit/codemirror-emacs#5