mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
chore(code): reintroduce tab index
This commit is contained in:
parent
1a7a65126e
commit
17194806db
@ -46,19 +46,11 @@ export default class EditableCodeTypeWidget extends AbstractCodeTypeWidget {
|
|||||||
return {
|
return {
|
||||||
placeholder: t("editable_code.placeholder"),
|
placeholder: t("editable_code.placeholder"),
|
||||||
vimKeybindings: options.is("vimKeymapEnabled"),
|
vimKeybindings: options.is("vimKeymapEnabled"),
|
||||||
onContentChanged: () => this.spacedUpdate.scheduleUpdate()
|
onContentChanged: () => this.spacedUpdate.scheduleUpdate(),
|
||||||
|
tabIndex: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// getExtraOpts(): Partial<CodeMirrorOpts> {
|
|
||||||
// return {
|
|
||||||
// lint: true,
|
|
||||||
// gutters: ["CodeMirror-lint-markers"],
|
|
||||||
// tabindex: 300,
|
|
||||||
// dragDrop: false, // with true the editor inlines dropped files which is not what we expect
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
async doRefresh(note: FNote) {
|
async doRefresh(note: FNote) {
|
||||||
const blob = await this.note?.getBlob();
|
const blob = await this.note?.getBlob();
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ export interface EditorConfig {
|
|||||||
lineWrapping?: boolean;
|
lineWrapping?: boolean;
|
||||||
vimKeybindings?: boolean;
|
vimKeybindings?: boolean;
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
|
tabIndex?: number;
|
||||||
onContentChanged?: ContentChangedListener;
|
onContentChanged?: ContentChangedListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +82,11 @@ export default class CodeMirror extends EditorView {
|
|||||||
parent: config.parent,
|
parent: config.parent,
|
||||||
extensions
|
extensions
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (config.tabIndex) {
|
||||||
|
this.dom.tabIndex = config.tabIndex;
|
||||||
|
}
|
||||||
|
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.languageCompartment = languageCompartment;
|
this.languageCompartment = languageCompartment;
|
||||||
this.historyCompartment = historyCompartment;
|
this.historyCompartment = historyCompartment;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user