diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 546512531..0c0ac8fe5 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3053,7 +3053,7 @@ void Notepad_plus::command(int id) _pEditView->execute(SCI_HIDELINES, startLine, endLine); _pEditView->execute(SCI_MARKERADD, startLine-1, MARK_HIDELINESBEGIN); _pEditView->execute(SCI_MARKERADD, endLine+1, MARK_HIDELINESEND); - + _hideLinesMarks.push_back(pair(startLine-1, endLine+1)); break; } @@ -6601,11 +6601,13 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case NPPM_INTERNAL_DOCSWITCHOFF : { + removeHideLinesBookmarks(); return TRUE; } case NPPM_INTERNAL_DOCSWITCHIN : { + _hideLinesMarks.empty(); return TRUE; } diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index c0b35612f..c703182bf 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -511,6 +511,8 @@ private: HWND _hParent; } _scintillaCtrls4Plugins; + vector> _hideLinesMarks; + static LRESULT CALLBACK Notepad_plus_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); @@ -913,6 +915,14 @@ private: } return userLangName; } + + void removeHideLinesBookmarks() { + for (size_t i = 0 ; i < _hideLinesMarks.size() ; i++) + { + hideLinesMarkDelete(_hideLinesMarks[i].first, MARK_HIDELINESBEGIN); + hideLinesMarkDelete(_hideLinesMarks[i].second, MARK_HIDELINESEND); + } + }; }; #endif //NOTEPAD_PLUS_H