Add auto-focus on opening files

This commit is contained in:
Quinten Kock 2025-10-29 17:08:56 +01:00
parent 02ecfb4bef
commit 27d085fbab
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,8 @@ export function addEditor(file: OpenFile) {
console.log("Adding editor to tab ", currentTab.val, editors); console.log("Adding editor to tab ", currentTab.val, editors);
const editor = file.createEditor(); const editor = file.createEditor();
editors[currentTab.val].push(vanX.noreactive(editor)); editors[currentTab.val].push(vanX.noreactive(editor));
editor.view.dom.scrollIntoView();
editor.view.focus();
} }
export function addTab(file?: OpenFile) { export function addTab(file?: OpenFile) {