An extension for CodeMirror that adds indentation for wrapped lines.
Using npm:
npm install codemirror-wrapped-line-indent
import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { wrappedLineIndent } from 'codemirror-wrapped-line-indent';
// ... your CodeMirror setup code ...
const state = EditorState.create({
// ... other state options ...
extensions: [
EditorView.lineWrapping,
wrappedLineIndent
]
});
const view = new EditorView({ state });