I’m learning CM 6 after using CM 5 previously.
I have a very basic editor config:
import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { python } from '@codemirror/lang-python';
import { basicSetup } from '@codemirror/basic-setup';
const state = EditorState.create({
extensions: [
basicSetup,
python(),
],
});
new EditorView({
state: state,
parent: DOM_ELEMENT,
});
The editor renders and works perfectly apart from the tabSize
. If I log state.tabSize
I get 4
.
However, if I type some Python code that triggers an indent, such as:
while True:
a = 2 # a dumb example
When I hit return after the while
to start the second line I get an indentation of 2 spaces, I would have expected 4…
Have I missed a step or misunderstood what tabSize
refers to?