mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 05:45:00 +02:00
Fix stream sort of selected text doing one too many lines
Fix #8447, close #8453
This commit is contained in:
parent
267da64d33
commit
5a2cabf14e
@ -583,7 +583,7 @@ void Notepad_plus::command(int id)
|
|||||||
hasLineSelection = selStart != selEnd;
|
hasLineSelection = selStart != selEnd;
|
||||||
if (hasLineSelection)
|
if (hasLineSelection)
|
||||||
{
|
{
|
||||||
pair<int, int> lineRange = _pEditView->getSelectionLinesRange();
|
const pair<int, int> lineRange = _pEditView->getSelectionLinesRange();
|
||||||
// One single line selection is not allowed.
|
// One single line selection is not allowed.
|
||||||
if (lineRange.first == lineRange.second)
|
if (lineRange.first == lineRange.second)
|
||||||
{
|
{
|
||||||
|
@ -2780,6 +2780,13 @@ pair<int, int> ScintillaEditView::getSelectionLinesRange() const
|
|||||||
range.first = static_cast<int32_t>(execute(SCI_LINEFROMPOSITION, start));
|
range.first = static_cast<int32_t>(execute(SCI_LINEFROMPOSITION, start));
|
||||||
range.second = static_cast<int32_t>(execute(SCI_LINEFROMPOSITION, end));
|
range.second = static_cast<int32_t>(execute(SCI_LINEFROMPOSITION, end));
|
||||||
|
|
||||||
|
if ((range.first != range.second) && (execute(SCI_POSITIONFROMLINE, range.second) == end))
|
||||||
|
{
|
||||||
|
// if the end of the selection includes the line-ending,
|
||||||
|
// then don't include the following line in the range
|
||||||
|
--range.second;
|
||||||
|
}
|
||||||
|
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user