forked from qt-creator/qt-creator
Editors: Update navigation history when closing with the tool button
The code path for the global actions (File menu, shortcut) were adding the closed document to the history, but the editor view local action did not. Move the call one level deeper, so it is done for both. That fixes Window > Go Back under some circumstances in which it didn't open closed files again. Change-Id: I74bdb02209b8ac7bb7714d9a827e3a0c30a4c9e9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -1473,6 +1473,7 @@ bool EditorManagerPrivate::activateEditorForEntry(EditorView *view, DocumentMode
|
||||
void EditorManagerPrivate::closeEditorOrDocument(IEditor *editor)
|
||||
{
|
||||
QTC_ASSERT(editor, return);
|
||||
EditorManager::addCurrentPositionToNavigationHistory();
|
||||
QList<IEditor *> visible = EditorManager::visibleEditors();
|
||||
if (Utils::contains(visible,
|
||||
[&editor](IEditor *other) {
|
||||
@@ -2690,7 +2691,6 @@ void EditorManager::slotCloseCurrentEditorOrDocument()
|
||||
{
|
||||
if (!d->m_currentEditor)
|
||||
return;
|
||||
addCurrentPositionToNavigationHistory();
|
||||
d->closeEditorOrDocument(d->m_currentEditor);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user