If i type any quote, CodeMirror automatically inserts another quote.
I want to disable it.
I can’t do it with the code below.
How can I fix this code?
javascriprt
const editView = new EditorView({
state: EditorState.create({
doc: value,
extensions: [
basicSetup,
javascript(),
autocompletion({
activateOnTyping: false,
defaultKeymap: false
}),
],
}),
parent: node,
});
closeBrackets
is part of basicSetup
. Use minimalSetup
or your own custom collection of extensions instead if you don’t want it.
(Or, even better if there was a way to enable/disable it at runtime)
If I want to use basicSetup for other reasons, since it’s almost exactly what I want, how would I go about disabling closeBrackets?
You’ll have to copy the code in basicSetup
and edit it for your situation. You’ll generally want to put together your own configuration at some point anyway—basicSetup
is just a helper to set up a basic editor, when starting a project or setting up a quick demo.
Ah! Understood. That’s fair. Is there any regular webpage that contains a template example of this to make it easy to copy/paste? Or should I be copying it from the sources? I found this fiddle, which seems to be a mostly? default basicSetup: Import fiddle as a JS Module - chain fiddles together - JSFiddle - Code Playground
This is the file that defines basicSetup
.