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

Esc in VIM mode unfocuses code editor in Vivaldi browser #7056

Open
drbogar opened this issue Aug 24, 2023 · 4 comments
Open

Esc in VIM mode unfocuses code editor in Vivaldi browser #7056

drbogar opened this issue Aug 24, 2023 · 4 comments

Comments

@drbogar
Copy link

drbogar commented Aug 24, 2023

Specs

OS: Windows 11 Pro
Browser: Vivaldi 6.1.3035.302 (Stable channel) (64 bites)
CodeMirror version: 5

Bug description

I can't use VIM mode because every time I press Esc, it pops out of the text box instead of just going into normal mode.

To Reproduce

  1. Open the codemirror VIM test site in Vivaldi!
  2. Click in the code box! You are NORMAL MODE by default.
  3. Press i to enter INSERT MODE!
  4. Press Esc!

Expected behavior

The code box is expected to react to further inputs of user after return to NORMAL MODE with Esc key.

Additional information

I've tested it in Chrome, Firefox and Edge and I'm experiencing the bug in vivaldi alone.
I've tested it in incognito mode, with all add-ons and ad block disabled and the error is still present.

@marijnh
Copy link
Member

marijnh commented Aug 24, 2023

If this browser doesn't let scripts intercept Esc presses, I don't think there's anything we can do about that.

@drbogar
Copy link
Author

drbogar commented Aug 24, 2023

@marijnh , Seems to work fine here:
https://unixpapa.com/js/testkey.html

@niklasl
Copy link

niklasl commented Sep 23, 2023

Scripts are able to capture Esc presses in Vivaldi. Vivaldi does however also automatically unfocus the backing textarea. Fortunately this is done sensibly, so it is stoppable by doing if (evt.key === 'Escape') evt.stopPropagation(). I think doing this in onKeyEventTargetKeyDown of codemirror5 Vim mode would solve this.

(One might blame Vivaldi here, but I really appreciate its default behavior, because of my Vim habits. Other browsers may follow suite (maybe Edge has already?), so it makes sense for codemirror to handle this.)

@ajilk
Copy link

ajilk commented Nov 26, 2023

Same thing is happening for Leetcode + VIM keyboard binding

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

4 participants