From f02e567c9eccade8b56d372b2865788e0651f8a2 Mon Sep 17 00:00:00 2001 From: Jon Fritzler Date: Mon, 8 Jun 2015 17:12:04 -0600 Subject: [PATCH] Fix slow tab switching while folding restoring. Resolve slow tab switching of folded XML file by setting the isFolding flag to true, so it can ignore events while folding is taking place, when switching tabs and when loading the next tab after deleting a tab. (closes #168, fixes #236 #329) --- PowerEditor/src/Notepad_plus.cpp | 2 ++ PowerEditor/src/NppNotification.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 66bfaa2d3..2e254a113 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3169,7 +3169,9 @@ bool Notepad_plus::removeBufferFromView(BufferID id, int whichOne) toActivate = active; //activate the 'active' index. Since we remove the tab first, the indices shift (on the right side) } tabToClose->deletItemAt((size_t)index); //delete first + _isFolding = true; // So we can ignore events while folding is taking place activateBuffer(tabToClose->getBufferByIndex(toActivate), whichOne); //then activate. The prevent jumpy tab behaviour + _isFolding = false; } } else diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 42fa84130..204038b60 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -263,8 +263,11 @@ BOOL Notepad_plus::notify(SCNotification *notification) switchEditViewTo(iView); BufferID bufid = _pDocTab->getBufferByIndex(_pDocTab->getCurrentTabIndex()); if (bufid != BUFFER_INVALID) + { + _isFolding = true; // So we can ignore events while folding is taking place activateBuffer(bufid, iView); - + _isFolding = false; + } break; }