Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/startmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,13 @@ int StartManager::recoverFile(Window *window)
} else if (recFilesSum > 0 && window->getTabbar()->count() > 0) {
// 焦点标签页文件不存在或无焦点记录,加载第一个可用标签页
qDebug() << "No focus tab available, loading first tab";
// 当仅剩 pending 标签页时,currentIndex 已被 addPendingTab 隐式设为 0,
// activeTab(0) 中的 setCurrentIndex(0) 不会触发 currentChanged 信号,
// 需显式加载该 pending 标签页,否则编辑区域为空且无法编辑
QString firstFile = window->getTabbar()->fileAt(0);
if (window->isPendingTab(firstFile)) {
window->loadPendingTab(firstFile);
Comment on lines +513 to +515

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Earlier windows open without editors

When the missing focus record leaves recoverable tabs in multiple saved windows, recoverFile() adds pending tabs to every recovery window, but this branch loads a tab only from the last window; earlier windows receive no currentChanged signal and retain unloaded tabs, so they open without file editors.

Iterate over every recovered window and explicitly load its current pending tab.

Prompt for AI agents
In `src/startmanager.cpp` at lines 513-515:

**Earlier windows open without editors**

When the missing focus record leaves recoverable tabs in multiple saved windows, `recoverFile()` adds pending tabs to every recovery window, but this branch loads a tab only from the last `window`; earlier windows receive no `currentChanged` signal and retain unloaded tabs, so they open without file editors.

Iterate over every recovered window and explicitly load its current pending tab.

}
window->activeTab(0);
}

Expand Down
Loading