Skip to content

Commit 4478869

Browse files
committed
修复typeformat在insert final line为false时得错误
1 parent e89f5c4 commit 4478869

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CodeService/src/LuaTypeFormat.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ void LuaTypeFormat::AnalysisReturn(int line, int character)
8484

8585
void LuaTypeFormat::CompleteMissToken(int line, int character, LuaError& luaError)
8686
{
87+
LuaCodeStyleOptions temp = _options;
88+
temp.insert_final_newline = true;
8789
switch (luaError.MissToken)
8890
{
8991
case TK_END:
@@ -149,7 +151,7 @@ void LuaTypeFormat::CompleteMissToken(int line, int character, LuaError& luaErro
149151
}
150152

151153
_hasResult = true;
152-
SerializeContext ctx(_parser, _options);
154+
SerializeContext ctx(_parser, temp);
153155
if (nextBrace)
154156
{
155157
ctx.PrintLine(1);

0 commit comments

Comments
 (0)