mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
wuffsfmt: indent with 4 spaces (not a tab)
This commit is contained in:
1 parent
9c03b8c71d
commit
f5eb38d76e
40 files changed
+12586
-12580
No files matched your search
+11
-6
@@ -294,13 +294,18 @@ func appendNum(buf []byte, s string) []byte {
|
||||
return buf
|
||||
}
|
||||
|
||||
func appendTabs(buf []byte, n int) []byte {
|
||||
if n > 0 {
|
||||
const tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"
|
||||
for ; n > len(tabs); n -= len(tabs) {
|
||||
buf = append(buf, tabs...)
|
||||
func appendTabs(buf []byte, nTabs int) []byte {
|
||||
nSpaces := 4 * nTabs // Hard-code 4 spaces per tab.
|
||||
if nSpaces > 0 {
|
||||
const spaces = "" + // 256 spaces.
|
||||
" " +
|
||||
" " +
|
||||
" " +
|
||||
" "
|
||||
for ; nSpaces > len(spaces); nSpaces -= len(spaces) {
|
||||
buf = append(buf, spaces...)
|
||||
}
|
||||
buf = append(buf, tabs[:n]...)
|
||||
buf = append(buf, spaces[:nSpaces]...)
|
||||
}
|
||||
return buf
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user