Open
Description
feature request:
I would love to see word wrap follow the current indentation level in the text editor. See
https://codemirror.net/demo/indentwrap.html
and
codemirror/codemirror5#2085The following image illustrates with the red line what I would like to see and the following code is all that is required to implement it:
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
lineWrapping: true,
mode: "text/html"
});
var charWidth = editor.defaultCharWidth(), basePadding = 4;
editor.on("renderLine", function(cm, line, elt) {
var off = CodeMirror.countColumn(line.text, null, cm.getOption("tabSize")) * charWidth;
elt.style.textIndent = "-" + off + "px";
elt.style.paddingLeft = (basePadding + off) + "px";
});
editor.refresh();
Thanks for the consideration.