Commit bb5c0389 authored by Christoph Cullmann's avatar Christoph Cullmann 🍨 Committed by Eric Armbruster
Browse files

ensure we create views for current tab after close

this can be lost because of the view creation blocking
parent 4abbd6dc
......@@ -427,26 +427,20 @@ void KateViewManager::documentsDeleted(const QList<KTextEditor::Document *> &)
m_blockViewCreationAndActivation = false;
/**
* if we have some active view, show them in all viewspaces that got empty!
* ensure we don't end up with empty tabs in some view spaces
* we did block view creation, re-trigger it
*/
if (KTextEditor::View *const newActiveView = activeView()) {
/**
* check if we have any empty viewspaces and give them a view
*/
for (KateViewSpace *vs : m_viewSpaceList) {
if (!vs->currentView()) {
createView(newActiveView->document(), vs);
}
}
/**
* reactivate will ensure we really merge up the GUI again
* this might be missed as above we had m_blockViewCreationAndActivation set to true
* see bug 426605, no view XMLGUI stuff merged after tab close
*/
reactivateActiveView();
for (auto vs : m_viewSpaceList) {
vs->ensureViewForCurrentTab();
}
/**
* reactivate will ensure we really merge up the GUI again
* this might be missed as above we had m_blockViewCreationAndActivation set to true
* see bug 426605, no view XMLGUI stuff merged after tab close
*/
reactivateActiveView();
// trigger action update
updateViewSpaceActions();
......
......@@ -194,6 +194,13 @@ public:
void focusNavigationBar();
// ensure we have a view for the current document tab, e.g. after document closing
void ensureViewForCurrentTab()
{
// just trigger change view, will do the needful
changeView(m_tabBar->currentIndex());
}
protected:
// DND
void dragEnterEvent(QDragEnterEvent *e) override;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment