aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-15 21:57:31 -0400
committerGitHub <noreply@github.com>2025-08-15 21:57:31 -0400
commit3b71481c7b2583dcdca3ca9fd9fcc8e0de22f62b (patch)
tree88e498bc2d92a3b434498f5c69d3eef090394671 /src
parent34e3bad043b1a98534863d66233f2e7411c51a6a (diff)
parent45d640d3f3c8c7970aa3101af6cd12f1fe857cd0 (diff)
Merge pull request #881 from BradLewis/fix/allman-braces-when-stmt
Fix issue formatting when statements with allman style braces
Diffstat (limited to 'src')
-rw-r--r--src/odin/printer/visit.odin2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin
index 0f3f691..55835f1 100644
--- a/src/odin/printer/visit.odin
+++ b/src/odin/printer/visit.odin
@@ -1247,7 +1247,9 @@ visit_stmt :: proc(
case ^When_Stmt:
document = cons(document, cons_with_nopl(text("when"), visit_expr(p, v.cond)))
+ set_source_position(p, v.body.pos)
document = cons_with_nopl(document, visit_stmt(p, v.body))
+ set_source_position(p, v.body.end)
if v.else_stmt != nil {
if p.config.brace_style == .Allman {