insomnia: Press and Hold not working on Vim keymap (on MacOS)

Describe the bug When I enable Vim keymap, long pressing a move key (j or k for instance) only moves the cursor once.

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘Settings’, enable Vim keymap in Text Editor Key Map
  2. Open a request body and long press j
  3. The cursor only moves one line down

Expected behavior The cursor should keep moving down until I stop pressing the key

Screenshots

Desktop (please complete the following information):

  • OS: macOS 11.4
  • Installation Method: Download
  • App Version: 2021.3.0

Additional context I tried to run command defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool true and restart Insomnia but it did not work

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

Very exciting stuff. Not only this fix, but I also love to see all the teamwork and collaboration happening here. If we do find a fix we should go back to https://github.com/codemirror/CodeMirror/issues/3678 and mention what we did (pointing back to the PR).

@MrSnix wow nice sleuthing, TIL electron can override variables like that. Let’s give it a go!

If okay then, I’d love to pick this up, I’ll make a PR to introduce this change.

Changing the OSX level variable mentioned in that PR does in fact fix vim mode in insomnia (after a restart of insomnia)

@MrSnix because it’s not an urgent bug fix needed for Insomnia I think the best approach will be to push this through an official fix on codemirror and only if the fix is no accepted there we think about a workaround through Insomnia. This does seem like a genuine bug so others will benefit from it too!

And I think we shouldn’t close this ticket necessarily, since it is a valid bug in Insomnia, but maybe mark as blocked on a dependency. It will still require a code-mirror update to Insomnia, and that update PR can close this issue.

As the PR title suggests, we chose not to automatically override any settings, rather provide a helpful tooltip and link to the documentation here to enable key-repeating on macOS.

@dimitropoulos @develohpanda

Quick update:

The electron interface works like a charm.

I’ll commit the fix in a few hour. It’s a one liner and it works really really well.

Yuppie

@MrSnix wow nice sleuthing, TIL electron can override variables like that. Let’s give it a go!

ohhh my bad, I misread to be that it doesn’t also happen on the codemirror website. I guess the next step then for us is to file an issue with them if one doesn’t already exist and close this ticket.

Looks like a bug in code mirror – Went their vim bindings demo on their website (https://codemirror.net/demo/vim.html) and the same bug happens on mac, but it works on windows

thanks @MrSnix!

well, haha @develohpanda I guess that means you’re gonna get this one whenever the time comes. (I don’t have access to a Mac device)