Restore previous codemirror tab behavior (#8461)

* Restore previous tab behavior

* Handle via ondemand logic

* Combine imports
This commit is contained in:
Philip Allgaier 2021-02-25 22:24:07 +01:00 committed by GitHub
parent f44d867d3a
commit 2f7f677549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -131,7 +131,14 @@ export class HaCodeEditor extends UpdatingElement {
loaded.lineNumbers(), loaded.lineNumbers(),
loaded.keymap.of([ loaded.keymap.of([
...loaded.defaultKeymap, ...loaded.defaultKeymap,
loaded.defaultTabBinding, {
key: "Tab",
run: loaded.indentMore,
},
{
key: "Shift-Tab",
run: loaded.indentLess,
},
saveKeyBinding, saveKeyBinding,
]), ]),
loaded.tagExtension(modeTag, this._mode), loaded.tagExtension(modeTag, this._mode),

View File

@ -7,7 +7,7 @@ import { yaml } from "@codemirror/legacy-modes/mode/yaml";
export { keymap } from "@codemirror/view"; export { keymap } from "@codemirror/view";
export { CMEditorView as EditorView }; export { CMEditorView as EditorView };
export { EditorState, Prec, tagExtension } from "@codemirror/state"; export { EditorState, Prec, tagExtension } from "@codemirror/state";
export { defaultKeymap, defaultTabBinding } from "@codemirror/commands"; export { defaultKeymap, indentLess, indentMore } from "@codemirror/commands";
export { lineNumbers } from "@codemirror/gutter"; export { lineNumbers } from "@codemirror/gutter";
export const langs = { export const langs = {