wuffsfmt: double-indents hanging lines

This commit is contained in:
Nigel Tao committed 2023-04-09 15:22:25 +10:00
1 parent d910658bce
commit 9c03b8c71d
40 files changed
+2579 -2571

No files matched your search

+2 -2
View File
@@ -65,7 +65,7 @@ func Render(w io.Writer, tm *t.Map, src []t.Token, comments []string) (err error
// Print any previous comments.
commentIndent := indent
if prevLineHanging {
commentIndent++
commentIndent += 2
}
for ; commentLine < line; commentLine++ {
buf = buf[:0]
@@ -115,7 +115,7 @@ func Render(w io.Writer, tm *t.Map, src []t.Token, comments []string) (err error
} else if id.IsClose() {
indentAdjustment--
} else if hanging && ((id != t.IDOpenCurly) && (id != t.IDOpenDoubleCurly)) {
indentAdjustment++
indentAdjustment += 2
}
buf = appendTabs(buf, indent+indentAdjustment)