mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
wuffsfmt: double-indents hanging lines
This commit is contained in:
1 parent
d910658bce
commit
9c03b8c71d
40 files changed
+2579
-2571
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user