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;
|
break;
|
||||||
|
|
||||||
case IDM_EDIT_JOIN_LINES:
|
case IDM_EDIT_JOIN_LINES:
|
||||||
_pEditView->execute(SCI_TARGETFROMSELECTION);
|
{
|
||||||
_pEditView->execute(SCI_LINESJOIN);
|
const pair<int, int> lineRange = _pEditView->getSelectionLinesRange();
|
||||||
break;
|
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:
|
case IDM_EDIT_LINE_UP:
|
||||||
_pEditView->currentLinesUp();
|
_pEditView->currentLinesUp();
|
||||||
|
|
Loading…
Reference in New Issue