1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fix crash when trying to move lines out of bounds

This commit is contained in:
Zorbn 2023-11-27 13:55:03 -08:00
parent 07daddb3f3
commit cc3bc66ca4

View file

@ -3666,12 +3666,16 @@ namespace IDE.ui
public void MoveLine(VertDir dir)
{
int lineNum = CursorLineAndColumn.mLine;
if ((dir == .Up && lineNum < 1) || (dir == .Down && lineNum >= GetLineCount() - 1))
return;
int endLineNum = lineNum;
GetLinePosition(lineNum, var lineStart, ?);
// Copy collapsed lines below as well
while (endLineNum < mLineCoords.Count - 1)
while (endLineNum < mLineCoords.Count - 2)
{
if (GetLineHeight(endLineNum + 1) > 0.1f)
break;