CodeMirror provides a indentWithTab
functionality to indent when pressing “Tab” key.
It works just fine and uses indentUnit.of(' '),
(four spaces indent) when language is set for editor instance (for example JS, TS, YAML).
The problem is that when no language is specified for CodeMirror editor, it uses the default two spaces indent completely ignoring indentUnit.of(...)
property.
Setting EditorState.tabSize.of(4)
does not work too.
How do I fix this?