diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 5e8be1e82..90b50ae33 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1578,6 +1578,22 @@ void Notepad_plus::deleteMarkedline(int ln) _pEditView->replaceTarget(emptyString, lineBegin, lineBegin + lineLen); } +void Notepad_plus::inverseMarks() +{ + int lastLine = _pEditView->lastZeroBasedLineNumber(); + for (int i = 0 ; i <= lastLine ; i++) + { + if (bookmarkPresent(i)) + { + bookmarkDelete(i); + } + else + { + bookmarkAdd(i); + } + } +} + void Notepad_plus::replaceMarkedline(int ln, const TCHAR *str) { int lineBegin = _pEditView->execute(SCI_POSITIONFROMLINE, ln); diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index c781243a5..cdab3c244 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -536,6 +536,7 @@ private: void deleteMarkedLines(); void pasteToMarkedLines(); void deleteMarkedline(int ln); + void inverseMarks(); void replaceMarkedline(int ln, const TCHAR *str); generic_string getMarkedLine(int ln); void findMatchingBracePos(int & braceAtCaret, int & braceOpposite); diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 21776f7b2..a4cf7dbb3 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -325,6 +325,7 @@ BEGIN MENUITEM "Copy Bookmarked Lines", IDM_SEARCH_COPYMARKEDLINES MENUITEM "Paste to (Replace) Bookmarked Lines", IDM_SEARCH_PASTEMARKEDLINES MENUITEM "Delete Bookmarked Lines", IDM_SEARCH_DELETEMARKEDLINES + MENUITEM "Inverse Bookmark", IDM_SEARCH_INVERSEMARKS END POPUP "&View" diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 952cbd13c..ca9192797 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -651,6 +651,10 @@ void Notepad_plus::command(int id) deleteMarkedLines(); break; + case IDM_SEARCH_INVERSEMARKS : + inverseMarks(); + break; + case IDM_VIEW_FULLSCREENTOGGLE : fullScreenToggle(); break; diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index 5304c77c6..960eefdf1 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -153,7 +153,7 @@ #define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48) #define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49) - + #define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50) #define IDM_VIEW (IDM + 4000) //#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1)