[BUG_FIXED] (Author: Andreas Jonsson) Bugfix: begin/end selection when the text is not constant.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1080 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2013-07-21 23:49:09 +00:00
parent 58716efa78
commit 9382bd3292
3 changed files with 16 additions and 1 deletions

View File

@ -49,6 +49,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
static bool prevWasEdit = false;
if (notification->modificationType & (SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT))
{
_pEditView->updateBeginEndSelectPosition(notification->modificationType & SC_MOD_INSERTTEXT, notification->position, notification->length);
prevWasEdit = true;
_linkTriggered = true;
::InvalidateRect(notifyView->getHSelf(), NULL, TRUE);

View File

@ -2057,6 +2057,19 @@ void ScintillaEditView::beginOrEndSelect()
}
}
void ScintillaEditView::updateBeginEndSelectPosition(const bool is_insert, const int position, const int length)
{
if(_beginSelectPosition != -1 && position < _beginSelectPosition - 1)
{
if(is_insert)
_beginSelectPosition += length;
else
_beginSelectPosition -= length;
assert(_beginSelectPosition >= 0);
}
}
void ScintillaEditView::marginClick(int position, int modifiers)
{
int lineClick = int(execute(SCI_LINEFROMPOSITION, position, 0));

View File

@ -335,7 +335,8 @@ public:
bool hasMarginShowed(int witchMarge) {
return (execute(SCI_GETMARGINWIDTHN, witchMarge, 0) != 0);
};
void updateBeginEndSelectPosition(const bool is_insert, const int position, const int length);
void marginClick(int position, int modifiers);
void setMakerStyle(folderStyle style) {