web/elements: insert spaces instead of tabs in codemirror

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-04-05 23:10:51 +02:00
parent e70490481d
commit 79ad356d90

View file

@ -112,6 +112,12 @@ export class CodeMirrorTextarea extends LitElement {
autoRefresh: true,
lineWrapping: true,
value: this._value,
extraKeys: {
Tab: (cm) => {
cm.execCommand("insertSoftTab");
},
},
indentUnit: 4,
});
this.editor.on("blur", () => {
this.editor?.save();