Skip to content

Commit edf4641

Browse files
committed
fix #109
1 parent 28bff89 commit edf4641

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

CodeService/src/Format/Analyzer/LineBreakAnalyzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void LineBreakAnalyzer::ComplexAnalyze(FormatState &f, const LuaSyntaxTree &t) {
9999
} else {
100100
switch (stmt.GetTokenKind(t)) {
101101
case TK_SHORT_COMMENT:
102-
case TK_LONG_STRING:
102+
case TK_LONG_COMMENT:
103103
case TK_SHEBANG: {
104104
BreakAfter(stmt, t, style.line_space_after_comment);
105105
break;

Test/src/FormatResult_unitest.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,4 +908,20 @@ local empty = function () end
908908
R"(
909909
local empty = function() end
910910
)"));
911+
}
912+
913+
TEST(Format, issue_109) {
914+
EXPECT_TRUE(TestHelper::TestFormatted(
915+
R"(
916+
--[[]]
917+
918+
919+
local t = 13 + 123
920+
)",
921+
R"(
922+
--[[]]
923+
924+
925+
local t = 13 + 123
926+
)"));
911927
}

0 commit comments

Comments
 (0)