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;
|
||||
if (hasLineSelection)
|
||||
{
|
||||
pair<int, int> lineRange = _pEditView->getSelectionLinesRange();
|
||||
const pair<int, int> lineRange = _pEditView->getSelectionLinesRange();
|
||||
// One single line selection is not allowed.
|
||||
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.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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue