diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 2b8c8fbba..a8695d406 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -773,6 +773,7 @@ void Notepad_plus::command(int id) { const int index = id - IDM_VIEW_TAB1; BufferID buf = _pDocTab->getBufferByIndex(index); + _isFolding = true; if(buf == BUFFER_INVALID) { // No buffer at chosen index, select the very last buffer instead. @@ -781,7 +782,10 @@ void Notepad_plus::command(int id) switchToFile(_pDocTab->getBufferByIndex(last_index)); } else + { switchToFile(buf); + } + _isFolding = false; } break; @@ -789,16 +793,21 @@ void Notepad_plus::command(int id) { const int current_index = _pDocTab->getCurrentTabIndex(); const int last_index = _pDocTab->getItemCount() - 1; + _isFolding = true; if(current_index < last_index) switchToFile(_pDocTab->getBufferByIndex(current_index + 1)); else + { switchToFile(_pDocTab->getBufferByIndex(0)); // Loop around. + } + _isFolding = false; } break; case IDM_VIEW_TAB_PREV: { const int current_index = _pDocTab->getCurrentTabIndex(); + _isFolding = true; if(current_index > 0) switchToFile(_pDocTab->getBufferByIndex(current_index - 1)); else @@ -806,6 +815,7 @@ void Notepad_plus::command(int id) const int last_index = _pDocTab->getItemCount() - 1; switchToFile(_pDocTab->getBufferByIndex(last_index)); // Loop around. } + _isFolding = false; } break; @@ -2899,6 +2909,7 @@ void Notepad_plus::command(int id) nbDoc += viewVisible(SUB_VIEW)?_subDocTab.nbItem():0; bool doTaskList = ((NppParameters::getInstance())->getNppGUI())._doTaskList; + _isFolding = true; if (nbDoc > 1) { bool direction = (id == IDC_NEXT_DOC)?dirDown:dirUp; @@ -2917,6 +2928,7 @@ void Notepad_plus::command(int id) } } } + _isFolding = false; _linkTriggered = true; } break; diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index e7b8d8ecf..e8bdabb31 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -1556,7 +1556,9 @@ void Notepad_plus::loadLastSession() const NppGUI & nppGui = nppParams->getNppGUI(); Session lastSession = nppParams->getSession(); bool isSnapshotMode = nppGui.isSnapshotMode(); + _isFolding = true; loadSession(lastSession, isSnapshotMode); + _isFolding = false; } bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode)