diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 75b16376..f64edaec 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -238,6 +238,12 @@ QDialog::DialogCode UBPersistenceManager::processInteractiveReplacementDialog(UB if (i != -1) { //replace QModelIndex replaceIndex = mDocumentTreeStructureModel->index(i, 0, parentIndex); UBDocumentProxy *replaceProxy = mDocumentTreeStructureModel->proxyData(replaceIndex); + + if (mDocumentTreeStructureModel->currentIndex() == replaceIndex) + { + UBApplication::documentController->selectDocument(pProxy, true, true); + } + if (replaceProxy) { deleteDocument(replaceProxy); }