Jupyterlab is doing soft wrap like this (with the setting "lineWrap": "on"):

But I would prefer something like this, like I have it in all my other text editors (emacs, intellij, vim...):

Is this possible? :)
JupyterLab is using CodeMirror and there is a hack for indentation of soft-wrap lines, published on https://codemirror.net/demo/indentwrap.html.
Code from that page:
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();
It's just a first step and I have no idea how to apply that hack inside JupyterLab (since CodeMirror is not a global variable in that environment). I hope someone will be able to build on top of this...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With