Skip to content

Commit 6c617f9

Browse files
committed
修复一个算法缺陷
1 parent 845de65 commit 6c617f9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CodeService/src/LuaFormatter.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,10 +1460,12 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatNodeAndBlockOrEnd(int& curren
14601460

14611461
for (auto blockChild : block->GetChildren())
14621462
{
1463-
auto shortExpression = std::make_shared<ExpressionElement>();
1464-
shortExpression->AddChildren(blockChild->GetChildren());
1465-
env->AddChild(shortExpression);
1466-
env->Add<KeepBlankElement>(1);
1463+
if (blockChild->HasValidTextRange()) {
1464+
auto shortExpression = std::make_shared<ExpressionElement>();
1465+
shortExpression->AddChildren(blockChild->GetChildren());
1466+
env->AddChild(shortExpression);
1467+
env->Add<KeepBlankElement>(1);
1468+
}
14671469
}
14681470
}
14691471
}

0 commit comments

Comments
 (0)