Fix Selected line count is 0 while the selection is on one line

fixes #1521, closes #1522
This commit is contained in:
Linquize 2016-02-21 23:35:41 +08:00 committed by Don Ho
parent e584c47429
commit 8113476dd7
1 changed files with 8 additions and 8 deletions

View File

@ -466,18 +466,18 @@ public:
// return false if it's multi-selection or rectangle selection
if ((execute(SCI_GETSELECTIONS) > 1) || execute(SCI_SELECTIONISRECTANGLE))
return false;
long start = long(execute(SCI_GETSELECTIONSTART));
long end = long(execute(SCI_GETSELECTIONEND));
selByte = end - start;
long pStart = long(execute(SCI_GETSELECTIONSTART));
long pEnd = long(execute(SCI_GETSELECTIONEND));
selByte = pEnd - pStart;
start = long(execute(SCI_LINEFROMPOSITION, start));
end = long(execute(SCI_LINEFROMPOSITION, end));
selLine = end - start;
if (selLine)
long lStart = long(execute(SCI_LINEFROMPOSITION, pStart));
long lEnd = long(execute(SCI_LINEFROMPOSITION, pEnd));
selLine = lEnd - lStart;
if (selLine || selByte)
++selLine;
return true;
};
};
long getSelectedLength() const
{