1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-29 12:55:59 +02:00

Merge pull request #1212 from miere43/delete-all-right

Add "Delete All Right" command to IDE
This commit is contained in:
Brian Fiete 2021-11-29 09:27:06 -08:00 committed by GitHub
commit 223b7b9e1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 0 deletions

View file

@ -2237,6 +2237,41 @@ namespace IDE.ui
return false;
}
public void DeleteAllRight()
{
int startPos;
int endPos;
if (HasSelection())
{
mSelection.ValueRef.GetAsForwardSelect(out startPos, out endPos);
}
else
{
startPos = endPos = CursorTextPos;
}
int line;
int lineChar;
GetLineCharAtIdx(endPos, out line, out lineChar);
let lineText = scope String();
GetLineText(line, lineText);
endPos += lineText.Length - lineChar;
if (startPos == endPos)
{
return;
}
mSelection = EditSelection();
mSelection.ValueRef.mStartPos = (int32)startPos;
mSelection.ValueRef.mEndPos = (int32)endPos;
DeleteSelection();
CursorTextPos = startPos;
}
public void DuplicateLine()
{