mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
Fix Selected line count is 0 while the selection is on one line
fixes #1521, closes #1522
This commit is contained in:
parent
e584c47429
commit
8113476dd7
@ -466,18 +466,18 @@ public:
|
|||||||
// return false if it's multi-selection or rectangle selection
|
// return false if it's multi-selection or rectangle selection
|
||||||
if ((execute(SCI_GETSELECTIONS) > 1) || execute(SCI_SELECTIONISRECTANGLE))
|
if ((execute(SCI_GETSELECTIONS) > 1) || execute(SCI_SELECTIONISRECTANGLE))
|
||||||
return false;
|
return false;
|
||||||
long start = long(execute(SCI_GETSELECTIONSTART));
|
long pStart = long(execute(SCI_GETSELECTIONSTART));
|
||||||
long end = long(execute(SCI_GETSELECTIONEND));
|
long pEnd = long(execute(SCI_GETSELECTIONEND));
|
||||||
selByte = end - start;
|
selByte = pEnd - pStart;
|
||||||
|
|
||||||
start = long(execute(SCI_LINEFROMPOSITION, start));
|
long lStart = long(execute(SCI_LINEFROMPOSITION, pStart));
|
||||||
end = long(execute(SCI_LINEFROMPOSITION, end));
|
long lEnd = long(execute(SCI_LINEFROMPOSITION, pEnd));
|
||||||
selLine = end - start;
|
selLine = lEnd - lStart;
|
||||||
if (selLine)
|
if (selLine || selByte)
|
||||||
++selLine;
|
++selLine;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
long getSelectedLength() const
|
long getSelectedLength() const
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user