fix(editor): preserve sql tab cursor state

This commit is contained in:
t8y2 committed 2026-06-09 18:18:18 +08:00
1 parent 80531c8765
commit 426b7911bc
6 files changed
+78 -2

No files matched your search

+7
View File
@@ -529,6 +529,12 @@ export const useQueryStore = defineStore("query", () => {
tab.editorViewport = viewport;
}
function updateEditorSelection(id: string, selection: { anchor: number; head: number }) {
const tab = tabs.value.find((t) => t.id === id);
if (!tab) return;
tab.editorSelection = selection;
}
function renameTab(id: string, title: string) {
const trimmed = title.trim();
if (!trimmed) return false;
@@ -1753,6 +1759,7 @@ export const useQueryStore = defineStore("query", () => {
releaseDatabaseTabs,
updateSql,
updateEditorViewport,
updateEditorSelection,
renameTab,
openObjectBrowser,
openUserAdmin,