mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-21 21:04:54 +02:00
[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:
parent
f6dafe8b08
commit
fdc6f7d8b0
@ -2973,6 +2973,10 @@ void Notepad_plus::command(int id)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDM_EDIT_DELETEMARKEDLINES :
|
||||||
|
markedLinesOperation(0);
|
||||||
|
break;
|
||||||
|
|
||||||
case IDM_VIEW_FULLSCREENTOGGLE :
|
case IDM_VIEW_FULLSCREENTOGGLE :
|
||||||
fullScreenToggle();
|
fullScreenToggle();
|
||||||
break;
|
break;
|
||||||
|
@ -536,6 +536,29 @@ private:
|
|||||||
_pEditView->execute(SCI_MARKERDELETEALL, MARK_BOOKMARK);
|
_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 {
|
int hideLinesMarkPresent(int lineno) const {
|
||||||
LRESULT state = _pEditView->execute(SCI_MARKERGET, lineno);
|
LRESULT state = _pEditView->execute(SCI_MARKERGET, lineno);
|
||||||
if ((state & (1 << MARK_HIDELINESBEGIN)) != 0)
|
if ((state & (1 << MARK_HIDELINESBEGIN)) != 0)
|
||||||
|
@ -305,8 +305,10 @@ BEGIN
|
|||||||
MENUITEM "Set Read Only", IDM_EDIT_SETREADONLY
|
MENUITEM "Set Read Only", IDM_EDIT_SETREADONLY
|
||||||
MENUITEM "Clear Read Only Flag", IDM_EDIT_CLEARREADONLY
|
MENUITEM "Clear Read Only Flag", IDM_EDIT_CLEARREADONLY
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Text Direction RTL", IDM_EDIT_RTL
|
MENUITEM "Cut marked lines", IDM_EDIT_CUTMARKEDLINES
|
||||||
MENUITEM "Text Direction LTR", IDM_EDIT_LTR
|
MENUITEM "Copy marked lines", IDM_EDIT_COPYMARKEDLINES
|
||||||
|
MENUITEM "Paste to (Replace) marked lines", IDM_EDIT_PASTEMARKEDLINES
|
||||||
|
MENUITEM "Delete marked lines", IDM_EDIT_DELETEMARKEDLINES
|
||||||
END
|
END
|
||||||
|
|
||||||
POPUP "&Search"
|
POPUP "&Search"
|
||||||
@ -383,9 +385,9 @@ BEGIN
|
|||||||
MENUITEM "Clone to another view", IDM_VIEW_CLONE_TO_ANOTHER_VIEW
|
MENUITEM "Clone to another view", IDM_VIEW_CLONE_TO_ANOTHER_VIEW
|
||||||
MENUITEM "Synchronize Vertical Scrolling", IDM_VIEW_SYNSCROLLV
|
MENUITEM "Synchronize Vertical Scrolling", IDM_VIEW_SYNSCROLLV
|
||||||
MENUITEM "Synchronize Horizontal Scrolling", IDM_VIEW_SYNSCROLLH
|
MENUITEM "Synchronize Horizontal Scrolling", IDM_VIEW_SYNSCROLLH
|
||||||
//MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
//MENUITEM "Vertical tabbar", IDM_VIEW_DRAWTABBAR_VERTICAL
|
MENUITEM "Text Direction RTL", IDM_EDIT_RTL
|
||||||
//MENUITEM "Multiline tabbar", IDM_VIEW_DRAWTABBAR_MULTILINE
|
MENUITEM "Text Direction LTR", IDM_EDIT_LTR
|
||||||
END
|
END
|
||||||
|
|
||||||
POPUP "For&mat"
|
POPUP "For&mat"
|
||||||
|
@ -76,6 +76,11 @@
|
|||||||
#define IDM_EDIT_COLUMNMODE (IDM_EDIT+34)
|
#define IDM_EDIT_COLUMNMODE (IDM_EDIT+34)
|
||||||
#define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT+35)
|
#define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT+35)
|
||||||
#define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT+36)
|
#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 (50000+0)
|
||||||
#define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000+1)
|
#define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000+1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user