diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 54651253..0c0ac8fe 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 c0b35612..c703182b 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