1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 20:30:28 +02:00

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.
This commit is contained in:
Andy Wingo 2023-11-15 09:35:23 +01:00
parent 75cd95060f
commit 437e5ac43d
2 changed files with 19 additions and 2 deletions

View file

@ -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))))))