[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:
parent
58716efa78
commit
9382bd3292
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue