mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 01:01:35 +01:00
wuffsfmt: double-indents hanging lines
This commit is contained in:
1 parent
d910658bce
commit
9c03b8c71d
2 files changed
+10
-2
No files matched your search
@@ -1,6 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
|
## Work In Progress
|
||||||
|
|
||||||
|
The dot points below probably aren't of interest unless you're _writing_ Wuffs
|
||||||
|
code (instead of writing C/C++ code that _uses_ Wuffs' standard library).
|
||||||
|
|
||||||
|
- `wuffsfmt` double-indents hanging lines.
|
||||||
|
|
||||||
|
|
||||||
## 2023-04-08 version 0.3.3
|
## 2023-04-08 version 0.3.3
|
||||||
|
|
||||||
The `wuffs_base__parse_number_f64` function has been further optimized.
|
The `wuffs_base__parse_number_f64` function has been further optimized.
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ func Render(w io.Writer, tm *t.Map, src []t.Token, comments []string) (err error
|
|||||||
// Print any previous comments.
|
// Print any previous comments.
|
||||||
commentIndent := indent
|
commentIndent := indent
|
||||||
if prevLineHanging {
|
if prevLineHanging {
|
||||||
commentIndent++
|
commentIndent += 2
|
||||||
}
|
}
|
||||||
for ; commentLine < line; commentLine++ {
|
for ; commentLine < line; commentLine++ {
|
||||||
buf = buf[:0]
|
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() {
|
} else if id.IsClose() {
|
||||||
indentAdjustment--
|
indentAdjustment--
|
||||||
} else if hanging && ((id != t.IDOpenCurly) && (id != t.IDOpenDoubleCurly)) {
|
} else if hanging && ((id != t.IDOpenCurly) && (id != t.IDOpenDoubleCurly)) {
|
||||||
indentAdjustment++
|
indentAdjustment += 2
|
||||||
}
|
}
|
||||||
buf = appendTabs(buf, indent+indentAdjustment)
|
buf = appendTabs(buf, indent+indentAdjustment)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user