Commit 8573b124 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Fix LRU tab behaviour

BUG: 434062
parent 2fcb0fba
Pipeline #140198 passed with stage
in 2 minutes and 25 seconds
......@@ -325,6 +325,16 @@ void KateViewSpace::removeView(KTextEditor::View *v)
// ...and now: remove from view space
stack->removeWidget(v);
// Remove the doc now!
// Why do this now? Because otherwise it messes up the LRU
// because we get two "currentChanged" signals
// - First signal when we "showView" below
// - Second comes soon after when v->document() is destroyed
// Handling (blocking) both signals here is necessary
m_tabBar->blockSignals(true);
documentDestroyed(v->document());
m_tabBar->blockSignals(false);
// switch to most recently used rather than letting stack choose one
// (last element could well be v->document() being removed here)
for (auto rit = m_registeredDocuments.rbegin(); rit != m_registeredDocuments.rend(); ++rit) {
......
Markdown is supported
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