Skip to content

Commit

Permalink
Fixed OpenCodeBlock indent/lockup issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bfiete committed Oct 2, 2020
1 parent a355f32 commit a804107
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions IDE/src/ui/SourceEditWidgetContent.bf
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,6 @@ namespace IDE.ui
// If we're aligned with the previous line then do the 'block indent' logic, otherwise are are already indented
if (indentCount == column / 4)
{
bool isLambdaOpen = false;
bool isExpr = false;

char8 prevC = 0;
Expand All @@ -1904,13 +1903,12 @@ namespace IDE.ui
{
let displayType = (SourceElementType)mData.mText[checkIdx].mDisplayTypeId;
if (displayType == .Comment)
continue;
prevC = mData.mText[checkIdx].mChar;
if (prevC == '>')
{
isLambdaOpen = true;
break;
checkIdx--;
continue;
}
prevC = mData.mText[checkIdx].mChar;

if (prevC == ')')
{
parenOpenCount++;
Expand All @@ -1932,15 +1930,15 @@ namespace IDE.ui
break;
if (prevC == '=')
{
isLambdaOpen = true;
isExpr = true;
break;
}
}

checkIdx--;
}

if ((isLambdaOpen) || (isExpr))
if (isExpr)
{
// Lambda opening or initializer expression
column += 4;
Expand Down

0 comments on commit a804107

Please sign in to comment.