♻️ Refactor cursor position cache

This commit is contained in:
2025-12-17 00:12:59 +08:00
parent 8fce8bdca4
commit 8a10b8fe0f
4 changed files with 94 additions and 36 deletions

View File

@@ -70,12 +70,11 @@ export const useDocumentStore = defineStore('document', () => {
// 在新窗口中打开文档
const openDocumentInNewWindow = async (docId: number): Promise<boolean> => {
try {
await OpenDocumentWindow(docId);
const tabStore = useTabStore();
if (tabStore.isTabsEnabled && tabStore.hasTab(docId)) {
tabStore.closeTab(docId);
}
await OpenDocumentWindow(docId);
return true;
} catch (error) {
console.error('Failed to open document in new window:', error);