From 5145dd3aa0c02c9fc496d1432fc4410674206e1d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:31 -0800 Subject: Import Upstream version 3a2 --- qp.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'qp.scm') diff --git a/qp.scm b/qp.scm index 0bfbef2..1dedf66 100644 --- a/qp.scm +++ b/qp.scm @@ -80,14 +80,17 @@ (qp-string (lambda (str room) + (define len (string-length str)) + (define mid (quotient (- room 3) 2)) (cond - ((>= (string-length str) room 3) - (display (substring str 0 (- room 3))) + ((>= len room 3) + (display (substring str 0 (- room 3 mid))) (display "...") + (display (substring str (- len mid) len)) room) (else (display str) - (string-length str))))) + len)))) (qp-obj (lambda (obj room) -- cgit v1.2.3