mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-28 00:04:25 +02:00
[NEW_FEATURE] (Author: Andreas Jonsson) Add Begin/End Select feature.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1057 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
fe5b147fe3
commit
874d5605c4
@ -223,14 +223,15 @@ BEGIN
|
|||||||
|
|
||||||
POPUP "&Edit"
|
POPUP "&Edit"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Undo", IDM_EDIT_UNDO
|
MENUITEM "&Undo", IDM_EDIT_UNDO
|
||||||
MENUITEM "&Redo", IDM_EDIT_REDO
|
MENUITEM "&Redo", IDM_EDIT_REDO
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Cu&t", IDM_EDIT_CUT
|
MENUITEM "Cu&t", IDM_EDIT_CUT
|
||||||
MENUITEM "&Copy", IDM_EDIT_COPY
|
MENUITEM "&Copy", IDM_EDIT_COPY
|
||||||
MENUITEM "&Paste", IDM_EDIT_PASTE
|
MENUITEM "&Paste", IDM_EDIT_PASTE
|
||||||
MENUITEM "&Delete", IDM_EDIT_DELETE
|
MENUITEM "&Delete", IDM_EDIT_DELETE
|
||||||
MENUITEM "Select A&ll", IDM_EDIT_SELECTALL
|
MENUITEM "Select A&ll", IDM_EDIT_SELECTALL
|
||||||
|
MENUITEM "Begin/End Select", IDM_EDIT_BEGINENDSELECT
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
POPUP "Copy to Clipboard"
|
POPUP "Copy to Clipboard"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -309,6 +309,12 @@ void Notepad_plus::command(int id)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDM_EDIT_BEGINENDSELECT:
|
||||||
|
{
|
||||||
|
_pEditView->beginOrEndSelect();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case IDM_EDIT_CHAR_PANEL:
|
case IDM_EDIT_CHAR_PANEL:
|
||||||
{
|
{
|
||||||
launchAnsiCharPanel();
|
launchAnsiCharPanel();
|
||||||
|
@ -106,6 +106,7 @@ WinMenuKeyDefinition winKeyDefs[] = {
|
|||||||
{VK_NULL, IDM_EDIT_TAB2SW, false, false, false, NULL},
|
{VK_NULL, IDM_EDIT_TAB2SW, false, false, false, NULL},
|
||||||
{VK_NULL, IDM_EDIT_SW2TAB_ALL, false, false, false, NULL},
|
{VK_NULL, IDM_EDIT_SW2TAB_ALL, false, false, false, NULL},
|
||||||
{VK_NULL, IDM_EDIT_SW2TAB_LEADING, false, false, false, NULL},
|
{VK_NULL, IDM_EDIT_SW2TAB_LEADING, false, false, false, NULL},
|
||||||
|
{VK_NULL, IDM_EDIT_BEGINENDSELECT, false, false, false, NULL},
|
||||||
|
|
||||||
{VK_C, IDM_EDIT_COLUMNMODE, false, true, false, NULL},
|
{VK_C, IDM_EDIT_COLUMNMODE, false, true, false, NULL},
|
||||||
{VK_U, IDM_EDIT_UPPERCASE, true, false, true, NULL},
|
{VK_U, IDM_EDIT_UPPERCASE, true, false, true, NULL},
|
||||||
|
@ -2043,7 +2043,20 @@ void ScintillaEditView::addText(int length, const char *buf)
|
|||||||
{
|
{
|
||||||
execute(SCI_ADDTEXT, length, (LPARAM)buf);
|
execute(SCI_ADDTEXT, length, (LPARAM)buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScintillaEditView::beginOrEndSelect()
|
||||||
|
{
|
||||||
|
if(_beginSelectPosition == -1)
|
||||||
|
{
|
||||||
|
_beginSelectPosition = execute(SCI_GETCURRENTPOS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
execute(SCI_SETANCHOR, (WPARAM)_beginSelectPosition);
|
||||||
|
_beginSelectPosition = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ScintillaEditView::marginClick(int position, int modifiers)
|
void ScintillaEditView::marginClick(int position, int modifiers)
|
||||||
{
|
{
|
||||||
int lineClick = int(execute(SCI_LINEFROMPOSITION, position, 0));
|
int lineClick = int(execute(SCI_LINEFROMPOSITION, position, 0));
|
||||||
|
@ -203,7 +203,7 @@ friend class Finder;
|
|||||||
public:
|
public:
|
||||||
ScintillaEditView()
|
ScintillaEditView()
|
||||||
: Window(), _pScintillaFunc(NULL),_pScintillaPtr(NULL),
|
: Window(), _pScintillaFunc(NULL),_pScintillaPtr(NULL),
|
||||||
_lineNumbersShown(false), _wrapRestoreNeeded(false)
|
_lineNumbersShown(false), _wrapRestoreNeeded(false), _beginSelectPosition(-1)
|
||||||
{
|
{
|
||||||
++_refCount;
|
++_refCount;
|
||||||
};
|
};
|
||||||
@ -277,6 +277,8 @@ public:
|
|||||||
void saveCurrentFold();
|
void saveCurrentFold();
|
||||||
void restoreCurrentFold();
|
void restoreCurrentFold();
|
||||||
|
|
||||||
|
void beginOrEndSelect();
|
||||||
|
|
||||||
int getCurrentDocLen() const {
|
int getCurrentDocLen() const {
|
||||||
return int(execute(SCI_GETLENGTH));
|
return int(execute(SCI_GETLENGTH));
|
||||||
};
|
};
|
||||||
@ -676,6 +678,8 @@ protected:
|
|||||||
typedef std::map<BufferID, StyleMap*> BufferStyleMap;
|
typedef std::map<BufferID, StyleMap*> BufferStyleMap;
|
||||||
BufferStyleMap _hotspotStyles;
|
BufferStyleMap _hotspotStyles;
|
||||||
|
|
||||||
|
int _beginSelectPosition;
|
||||||
|
|
||||||
//Lexers and Styling
|
//Lexers and Styling
|
||||||
void restyleBuffer();
|
void restyleBuffer();
|
||||||
const char * getCompleteKeywordList(std::basic_string<char> & kwl, LangType langType, int keywordIndex);
|
const char * getCompleteKeywordList(std::basic_string<char> & kwl, LangType langType, int keywordIndex);
|
||||||
|
@ -18,6 +18,7 @@ http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Context_Menu
|
|||||||
<Item MenuEntryName="Edit" MenuItemName="Paste"/>
|
<Item MenuEntryName="Edit" MenuItemName="Paste"/>
|
||||||
<Item MenuEntryName="Edit" MenuItemName="Delete"/>
|
<Item MenuEntryName="Edit" MenuItemName="Delete"/>
|
||||||
<Item MenuEntryName="Edit" MenuItemName="Select all"/>
|
<Item MenuEntryName="Edit" MenuItemName="Select all"/>
|
||||||
|
<Item MenuEntryName="Edit" MenuItemName="Begin/End Select"/>
|
||||||
|
|
||||||
<!-- id="0" is the separator -->
|
<!-- id="0" is the separator -->
|
||||||
<Item id="0"/>
|
<Item id="0"/>
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
#define IDM_EDIT_PASTE (IDM_EDIT + 5)
|
#define IDM_EDIT_PASTE (IDM_EDIT + 5)
|
||||||
#define IDM_EDIT_DELETE (IDM_EDIT + 6)
|
#define IDM_EDIT_DELETE (IDM_EDIT + 6)
|
||||||
#define IDM_EDIT_SELECTALL (IDM_EDIT + 7)
|
#define IDM_EDIT_SELECTALL (IDM_EDIT + 7)
|
||||||
|
#define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20)
|
||||||
|
|
||||||
#define IDM_EDIT_INS_TAB (IDM_EDIT + 8)
|
#define IDM_EDIT_INS_TAB (IDM_EDIT + 8)
|
||||||
#define IDM_EDIT_RMV_TAB (IDM_EDIT + 9)
|
#define IDM_EDIT_RMV_TAB (IDM_EDIT + 9)
|
||||||
|
@ -29,12 +29,12 @@
|
|||||||
#ifndef RESOURCE_H
|
#ifndef RESOURCE_H
|
||||||
#define RESOURCE_H
|
#define RESOURCE_H
|
||||||
|
|
||||||
#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v6.3.3")
|
#define NOTEPAD_PLUS_VERSION TEXT("Notepad++ v6.4")
|
||||||
|
|
||||||
// should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
// should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
||||||
// ex : #define VERSION_VALUE TEXT("5.63\0")
|
// ex : #define VERSION_VALUE TEXT("5.63\0")
|
||||||
#define VERSION_VALUE TEXT("6.33\0")
|
#define VERSION_VALUE TEXT("6.4\0")
|
||||||
#define VERSION_DIGITALVALUE 6, 3, 3, 0
|
#define VERSION_DIGITALVALUE 6, 4, 0, 0
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
#define UNICODE_ANSI_MODE TEXT("(UNICODE)")
|
#define UNICODE_ANSI_MODE TEXT("(UNICODE)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user