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
1 changed files with 6 additions and 0 deletions

View File

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