mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-20 12:24:49 +02:00
Fix condition where Join Lines does one too many lines
Fix #8503, close #8506
This commit is contained in:
parent
4bf662d031
commit
8b93240c59
@ -1438,9 +1438,18 @@ void Notepad_plus::command(int id)
|
||||
break;
|
||||
|
||||
case IDM_EDIT_JOIN_LINES:
|
||||
_pEditView->execute(SCI_TARGETFROMSELECTION);
|
||||
_pEditView->execute(SCI_LINESJOIN);
|
||||
break;
|
||||
{
|
||||
const pair<int, int> lineRange = _pEditView->getSelectionLinesRange();
|
||||
if (lineRange.first != lineRange.second)
|
||||
{
|
||||
auto anchorPos = _pEditView->execute(SCI_POSITIONFROMLINE, lineRange.first);
|
||||
auto caretPos = _pEditView->execute(SCI_GETLINEENDPOSITION, lineRange.second);
|
||||
_pEditView->execute(SCI_SETSELECTION, caretPos, anchorPos);
|
||||
_pEditView->execute(SCI_TARGETFROMSELECTION);
|
||||
_pEditView->execute(SCI_LINESJOIN);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_EDIT_LINE_UP:
|
||||
_pEditView->currentLinesUp();
|
||||
|
Loading…
x
Reference in New Issue
Block a user