I am trying to make CodeMirror 6 work more like VSCode (Monaco). I would like to know how to make clicking add a selection range ONLY if the Alt key is pressed, not the Ctrl / Cmd key. Is there any way to make this work? I have been looking through the reference manual, and I couldn’t find anything to help.
Adding this as an extension should do it:
EditorView.clickAddSelectionRange.of(e => e.altKey)
1 Like
Adding the extension works, however, when using it, you can’t add selection ranges when clicking to the right side of the text.
basicSetup
sets up rectangular selections to use alt. You probably need to remove those from your configuration to use alt for adding selection ranges.
I tried removing the rectangularSelection
extension, and it worked. Thank you!