[NEW_FEATURE] Marked line operation (in progress).

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@208 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-05-26 17:38:27 +00:00
parent f6dafe8b08
commit fdc6f7d8b0
4 changed files with 39 additions and 5 deletions

View File

@ -2973,6 +2973,10 @@ void Notepad_plus::command(int id)
}
break;
case IDM_EDIT_DELETEMARKEDLINES :
markedLinesOperation(0);
break;
case IDM_VIEW_FULLSCREENTOGGLE :
fullScreenToggle();
break;

View File

@ -536,6 +536,29 @@ private:
_pEditView->execute(SCI_MARKERDELETEALL, MARK_BOOKMARK);
};
void markedLinesOperation(int whichOp) {
int nbLine = _pEditView->getNbLine();
for (int i = 0 ; i < nbLine ; i++)
{
if (bookmarkPresent(i))
lineOperation(i, whichOp);
}
};
void lineOperation(int ln, int op) {
int lineLen = _pEditView->execute(SCI_LINELENGTH, ln);
int lineBegin = _pEditView->execute(SCI_POSITIONFROMLINE, ln);
bookmarkDelete(ln);
_pEditView->execute(SCI_SETTARGETSTART, lineBegin);
_pEditView->execute(SCI_SETTARGETEND, lineBegin + lineLen);
char emptyString[2] = "";
_pEditView->execute(SCI_REPLACETARGET, strlen(emptyString), (LPARAM)emptyString);
};
int hideLinesMarkPresent(int lineno) const {
LRESULT state = _pEditView->execute(SCI_MARKERGET, lineno);
if ((state & (1 << MARK_HIDELINESBEGIN)) != 0)

View File

@ -305,8 +305,10 @@ BEGIN
MENUITEM "Set Read Only", IDM_EDIT_SETREADONLY
MENUITEM "Clear Read Only Flag", IDM_EDIT_CLEARREADONLY
MENUITEM SEPARATOR
MENUITEM "Text Direction RTL", IDM_EDIT_RTL
MENUITEM "Text Direction LTR", IDM_EDIT_LTR
MENUITEM "Cut marked lines", IDM_EDIT_CUTMARKEDLINES
MENUITEM "Copy marked lines", IDM_EDIT_COPYMARKEDLINES
MENUITEM "Paste to (Replace) marked lines", IDM_EDIT_PASTEMARKEDLINES
MENUITEM "Delete marked lines", IDM_EDIT_DELETEMARKEDLINES
END
POPUP "&Search"
@ -383,9 +385,9 @@ BEGIN
MENUITEM "Clone to another view", IDM_VIEW_CLONE_TO_ANOTHER_VIEW
MENUITEM "Synchronize Vertical Scrolling", IDM_VIEW_SYNSCROLLV
MENUITEM "Synchronize Horizontal Scrolling", IDM_VIEW_SYNSCROLLH
//MENUITEM SEPARATOR
//MENUITEM "Vertical tabbar", IDM_VIEW_DRAWTABBAR_VERTICAL
//MENUITEM "Multiline tabbar", IDM_VIEW_DRAWTABBAR_MULTILINE
MENUITEM SEPARATOR
MENUITEM "Text Direction RTL", IDM_EDIT_RTL
MENUITEM "Text Direction LTR", IDM_EDIT_LTR
END
POPUP "For&mat"

View File

@ -76,6 +76,11 @@
#define IDM_EDIT_COLUMNMODE (IDM_EDIT+34)
#define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT+35)
#define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT+36)
#define IDM_EDIT_CUTMARKEDLINES (IDM_EDIT+42)
#define IDM_EDIT_COPYMARKEDLINES (IDM_EDIT+43)
#define IDM_EDIT_PASTEMARKEDLINES (IDM_EDIT+44)
#define IDM_EDIT_DELETEMARKEDLINES (IDM_EDIT+45)
#define IDM_EDIT_AUTOCOMPLETE (50000+0)
#define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000+1)