mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +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:
commit
548ec92d55
1 changed files with 6 additions and 2 deletions
|
@ -3666,12 +3666,16 @@ namespace IDE.ui
|
||||||
public void MoveLine(VertDir dir)
|
public void MoveLine(VertDir dir)
|
||||||
{
|
{
|
||||||
int lineNum = CursorLineAndColumn.mLine;
|
int lineNum = CursorLineAndColumn.mLine;
|
||||||
|
|
||||||
|
if ((dir == .Up && lineNum < 1) || (dir == .Down && lineNum >= GetLineCount() - 1))
|
||||||
|
return;
|
||||||
|
|
||||||
int endLineNum = lineNum;
|
int endLineNum = lineNum;
|
||||||
|
|
||||||
GetLinePosition(lineNum, var lineStart, ?);
|
GetLinePosition(lineNum, var lineStart, ?);
|
||||||
|
|
||||||
// Copy collapsed lines below as well
|
// Copy collapsed lines below as well
|
||||||
while (endLineNum < mLineCoords.Count - 1)
|
while (endLineNum < mLineCoords.Count - 2)
|
||||||
{
|
{
|
||||||
if (GetLineHeight(endLineNum + 1) > 0.1f)
|
if (GetLineHeight(endLineNum + 1) > 0.1f)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue