[NEW_FEATURE] Add "Inverse bookmark" feature.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@636 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2010-05-27 00:05:51 +00:00
parent 52539b01b9
commit 3c7a885a89
5 changed files with 23 additions and 1 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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"

View File

@ -651,6 +651,10 @@ void Notepad_plus::command(int id)
deleteMarkedLines();
break;
case IDM_SEARCH_INVERSEMARKS :
inverseMarks();
break;
case IDM_VIEW_FULLSCREENTOGGLE :
fullScreenToggle();
break;

View File

@ -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)