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

Merge pull request #1906 from Zorbn/fix-move-line-crash

Fix IDE crash when trying to move lines out of bounds
This commit is contained in:
Brian Fiete 2023-11-28 06:22:49 -05:00 committed by GitHub
commit 548ec92d55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;