summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2023-11-15 09:35:23 +0100
committerAndy Wingo <wingo@pobox.com>2023-11-15 09:35:23 +0100
commit437e5ac43d89fbab902003dfce4e6982f350ffb5 (patch)
tree7470e9b2e6ba3ef486188901d68be27670d076fb /module
parent75cd95060fb1ea7586f0e4b9081694c6d61f1d3b (diff)
downloadguile-437e5ac43d89fbab902003dfce4e6982f350ffb5.tar.gz
Fix pretty-print with a per-line prefix
* module/ice-9/pretty-print.scm (pretty-print): Include the per-line prefix in the indent. * test-suite/tests/print.test ("pretty-print"): Add test.
Diffstat (limited to 'module')
-rw-r--r--module/ice-9/pretty-print.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/ice-9/pretty-print.scm b/module/ice-9/pretty-print.scm
index 7a649a4f0..fa0402a18 100644
--- a/module/ice-9/pretty-print.scm
+++ b/module/ice-9/pretty-print.scm
@@ -114,7 +114,7 @@ port directly after OBJ, like (pretty-print OBJ PORT)."
((< to col)
(put-string port "\n")
(put-string port per-line-prefix)
- (spaces to))
+ (spaces (- to (string-length per-line-prefix))))
(else
(spaces (- to col))))))