-
Notifications
You must be signed in to change notification settings - Fork 43
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
Esc key does not exit insert mode in notebooks opened from file browser or launcher #94
Comments
Yes, but the goal is to have this extension work without bugs until then so we need to fix it ;) As mentioned in #90 the search shortcut is problematic as it takes precedence. It is no longer the case in JupyterLab 4.1 alpha. We could try to backport a fix but it involves changing shortcuts and does not really belong in a patch release. In #90 I worked around the issue for file editors by adding a shortcut with higher precedence (which relies on some lumino implementation detail and DOM hierarchy). Something like: {
"command": "vim:enter-normal-mode",
"keys": ["Escape"],
"selector": ".jp-Notebook"
}, for notebook may do. Can you confirm if this helps? |
Yes, this seems to work. Thanks for the quick response! Can you add a PR then? |
Upon further testing, it seems like at least some command mode shortcuts, i.e., those starting with Ctrl+O, seem to also be borked in version 4.0.0, presumably after #90 was merged. I don't know if whether it's related or a separate issue that I should open a separate ticket for. |
Can you confirm that #95 fixes both issues? |
Yes. Thanks! |
Should be fixed in the latest release. and hopefully this release will also work on conda-forge as well |
Hi @ianhi, I think this can be unpinned now. What do you think? |
Description
After entering insert mode from a notebook opened from the file browser or launcher, pressing Esc does not exit out of insert mode. Instead, it fires a "Cannot execute key binding 'Escape': command 'documentsearch:end' is not enabled." warning (see console log at bottom).
If the notebook is already opened when the JL page is refreshed, Esc exits out of insert mode as expected. In this case, pressing Esc in normal mode fires the warning above, without apparent user-facing side effects.
Ctrl+] is able to exit insert mode as a workaround.
I'm wondering if this has something to do with #90... @krassowski, do you know if this is expected to resolve itself when JL 4.1 is released?
Context
Console log
The text was updated successfully, but these errors were encountered: