Problems when binding with codemirror6

Hi, marijn:

Thanks for all your great projects, especially prosemirror and codemirror.:clap:

I am trying to bind codemirror6 to prosemirror and I’ve had some complicated problems!

Refer to your example which use the old version of codemirror, I made a demo for codemirror6.

demo link: optimistic-hoover-5uuy2 - CodeSandbox

Then let me explain problems!

Case one: without using the history stack and keymap of codemirror

  • At the start of the code block , press delete, the editor lost focus.


  • In code editor, redo and undo action will make the cursor at wrong position.


Case two: use the history stack and keymap of codemirror

  • Delete at code start place also make outer editor lost focus.

  • When undo or redo, outer editor history lost… :disappointed:


By the way, in the official codemirror example, when clear all content of the code editor, then press delete, the code block can not delete.I think it’s bad for user experience.🥸