Fix condition where Split Lines does one too many lines
Fix #8504, close #8507
This commit is contained in:
parent
b935bc6bf3
commit
4bf662d031
@ -1415,6 +1415,13 @@ void Notepad_plus::command(int id)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IDM_EDIT_SPLIT_LINES:
|
case IDM_EDIT_SPLIT_LINES:
|
||||||
|
{
|
||||||
|
pair<int, int> lineRange = _pEditView->getSelectionLinesRange();
|
||||||
|
if (lineRange.first != -1)
|
||||||
|
{
|
||||||
|
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_TARGETFROMSELECTION);
|
||||||
if (_pEditView->execute(SCI_GETEDGEMODE) == EDGE_NONE)
|
if (_pEditView->execute(SCI_GETEDGEMODE) == EDGE_NONE)
|
||||||
{
|
{
|
||||||
@ -1426,6 +1433,8 @@ void Notepad_plus::command(int id)
|
|||||||
auto edgeCol = _pEditView->execute(SCI_GETEDGECOLUMN);
|
auto edgeCol = _pEditView->execute(SCI_GETEDGECOLUMN);
|
||||||
_pEditView->execute(SCI_LINESSPLIT, textWidth * edgeCol);
|
_pEditView->execute(SCI_LINESSPLIT, textWidth * edgeCol);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IDM_EDIT_JOIN_LINES:
|
case IDM_EDIT_JOIN_LINES:
|
||||||
|
Loading…
Reference in New Issue
Block a user