diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-12-01 00:43:22 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-12-05 02:52:22 +0100 |
| commit | 682783a2aabad34e838493bb1e4c2437fd13058a (patch) | |
| tree | ab1c1cc1dcd49524b2eaeb8b935a2ce67420b82a /core/encoding/xml | |
| parent | 46a4927acad674b3265969bd5bde591b480d0c73 (diff) | |
[xml] Tab indentation in debug printer.
Diffstat (limited to 'core/encoding/xml')
| -rw-r--r-- | core/encoding/xml/debug_print.odin | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/encoding/xml/debug_print.odin b/core/encoding/xml/debug_print.odin index be1175cbc..c4d6875cc 100644 --- a/core/encoding/xml/debug_print.odin +++ b/core/encoding/xml/debug_print.odin @@ -47,10 +47,9 @@ print_element :: proc(writer: io.Writer, element: ^Element, indent := 0) -> (wri using fmt tab :: proc(writer: io.Writer, indent: int) { - tabs := "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" - - i := max(0, min(indent, len(tabs))) - wprintf(writer, "%v", tabs[:i]) + for _ in 0..=indent { + wprintf(writer, "\t") + } } tab(writer, indent) |