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
8 changes: 6 additions & 2 deletions tabbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ void TabBar::closeTab(int index)
if (index < 0 || index >= m_editors.size())
return;

Core::EditorManager::instance()->closeEditor(m_editors.takeAt(index));
removeTab(index);
// error if user click close button to close a document which is modified and not saved,
// this call will defalt call closeEditor with closeEditor(IEditor *editor, bool askAboutModifiedEditors = true)
// if user chose "cancel", the Core::EditorManager won't close the editor, TabBar use takeAt will remove the editor from
// the container m_editors and call removeTab() to remove from QTabBar
Core::EditorManager::instance()->closeEditor(m_editors.value(index));

}

void TabBar::prevTabAction()
Expand Down