Skip to content

Commit 7859a9b

Browse files
committed
Fix indentation not being stripped when the line starts with an interpolation
1 parent cba024a commit 7859a9b

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/loreline/Interpreter.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3813,7 +3813,7 @@ typedef InterpreterOptions = {
38133813
if (c != " ".code && c != "\t".code) break;
38143814
indent++;
38153815
}
3816-
if (indent < line.uLength()) {
3816+
if (indent > 0) {
38173817
if (minIndent == -1 || indent < minIndent) {
38183818
minIndent = indent;
38193819
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
state
3+
name: "Justin"
4+
5+
character narrator
6+
name: Narrator
7+
8+
beat Main
9+
// Multiline dialogue where second line starts with interpolation
10+
narrator:
11+
First line of text.
12+
${name == "Justin" ? "Effrayé" : "Effrayée"}, second line continues here.
13+
14+
// Multiline dialogue where second line starts with interpolation
15+
First line of text.
16+
${name == "Justin" ? "Effrayé" : "Effrayée"}, second line continues here.
17+
18+
/*
19+
<test>
20+
- expected: |
21+
Narrator:
22+
First line of text.
23+
Effrayé, second line continues here.
24+
25+
~ First line of text.
26+
Effrayé, second line continues here.
27+
</test>
28+
*/

0 commit comments

Comments
 (0)