replit/codemirror-emacs

Autocomplete up and down arrow keys don't work in example configuration

Closed this issue · 5 comments

  1. Update your dev environment to have the latest CM6 packages. yarn upgrade should do it
  2. Start the development environment and open the dev page in a browser
  3. Place the cursor on the last line of the document and type 'c' so that the autocomplete menu pops up
  4. Press the down arrow key. Nothing happens. It should move the highlight onto the next item in the autocomplete menu.

The reason this happens is that the Emacs bindings use a DOM keydown handler rather than a CM6 keymap, and in CM6, either all keymaps are run before the DOM handler or all keymaps are run after the DOM handler. In the default configuration, and indeed any useful configuration, we have the latter. The problem is that the autocomplete arrow key bindings, which have the highest precedence within keymaps, are never run because the Emacs DOM handler handles arrow keypresses first and swallows them.

I'm not observing this behavior. You can see that here https://codemirror-emacs.util.repl.co/

hmm.mp4

I suspect your dev environment hasn't got the latest CM6 packages then. I should have added that step, and I have now.

I see, you're right. It breaks in 6.3.0

@nightwing are you able to help get #5 merged?

I think we need to migrate both of these libraries to use the CM6 keymap functionality. This issue reproduces with some combination of a local build + CM6 package versions.