[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:
parent
52539b01b9
commit
3c7a885a89
|
@ -1578,6 +1578,22 @@ void Notepad_plus::deleteMarkedline(int ln)
|
||||||
_pEditView->replaceTarget(emptyString, lineBegin, lineBegin + lineLen);
|
_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)
|
void Notepad_plus::replaceMarkedline(int ln, const TCHAR *str)
|
||||||
{
|
{
|
||||||
int lineBegin = _pEditView->execute(SCI_POSITIONFROMLINE, ln);
|
int lineBegin = _pEditView->execute(SCI_POSITIONFROMLINE, ln);
|
||||||
|
|
|
@ -536,6 +536,7 @@ private:
|
||||||
void deleteMarkedLines();
|
void deleteMarkedLines();
|
||||||
void pasteToMarkedLines();
|
void pasteToMarkedLines();
|
||||||
void deleteMarkedline(int ln);
|
void deleteMarkedline(int ln);
|
||||||
|
void inverseMarks();
|
||||||
void replaceMarkedline(int ln, const TCHAR *str);
|
void replaceMarkedline(int ln, const TCHAR *str);
|
||||||
generic_string getMarkedLine(int ln);
|
generic_string getMarkedLine(int ln);
|
||||||
void findMatchingBracePos(int & braceAtCaret, int & braceOpposite);
|
void findMatchingBracePos(int & braceAtCaret, int & braceOpposite);
|
||||||
|
|
|
@ -325,6 +325,7 @@ BEGIN
|
||||||
MENUITEM "Copy Bookmarked Lines", IDM_SEARCH_COPYMARKEDLINES
|
MENUITEM "Copy Bookmarked Lines", IDM_SEARCH_COPYMARKEDLINES
|
||||||
MENUITEM "Paste to (Replace) Bookmarked Lines", IDM_SEARCH_PASTEMARKEDLINES
|
MENUITEM "Paste to (Replace) Bookmarked Lines", IDM_SEARCH_PASTEMARKEDLINES
|
||||||
MENUITEM "Delete Bookmarked Lines", IDM_SEARCH_DELETEMARKEDLINES
|
MENUITEM "Delete Bookmarked Lines", IDM_SEARCH_DELETEMARKEDLINES
|
||||||
|
MENUITEM "Inverse Bookmark", IDM_SEARCH_INVERSEMARKS
|
||||||
END
|
END
|
||||||
|
|
||||||
POPUP "&View"
|
POPUP "&View"
|
||||||
|
|
|
@ -651,6 +651,10 @@ void Notepad_plus::command(int id)
|
||||||
deleteMarkedLines();
|
deleteMarkedLines();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDM_SEARCH_INVERSEMARKS :
|
||||||
|
inverseMarks();
|
||||||
|
break;
|
||||||
|
|
||||||
case IDM_VIEW_FULLSCREENTOGGLE :
|
case IDM_VIEW_FULLSCREENTOGGLE :
|
||||||
fullScreenToggle();
|
fullScreenToggle();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -153,7 +153,7 @@
|
||||||
|
|
||||||
#define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48)
|
#define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48)
|
||||||
#define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49)
|
#define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49)
|
||||||
|
#define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50)
|
||||||
|
|
||||||
#define IDM_VIEW (IDM + 4000)
|
#define IDM_VIEW (IDM + 4000)
|
||||||
//#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1)
|
//#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1)
|
||||||
|
|
Loading…
Reference in New Issue