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 标签页永远不被加载。此处显式加载第一个 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 stay unloaded

When recovery spans multiple windows and the saved focus-file record is skipped, recoverFile calls loadPendingTab only on the final window. Earlier windows have already selected their first pending tab while signals are blocked, so handleCurrentChanged does not load it; those windows remain without an editor until the user switches tabs.

Load the first pending tab in every recovered window, not only the final window.

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

**Earlier windows stay unloaded**

When recovery spans multiple windows and the saved focus-file record is skipped, `recoverFile` calls `loadPendingTab` only on the final `window`. Earlier windows have already selected their first pending tab while signals are blocked, so `handleCurrentChanged` does not load it; those windows remain without an editor until the user switches tabs.

Load the first pending tab in every recovered window, not only the final `window`.

}
window->activeTab(0);
}

Expand Down
Loading