Finish alignment.

This commit is contained in:
Dominik Pantůček 2023-03-29 09:00:12 +02:00
parent 3f50d85412
commit 965b0432fa
4 changed files with 19 additions and 5 deletions

View file

@ -150,8 +150,16 @@
(if (< len w)
(let* ((miss (- w len))
(do-left-pad first-tab)
(do-right-pad (or (not first-tab) last-tab)))
(string-append line1 (string-repeat " " miss)))
(do-right-pad (or (not first-tab) last-tab))
(left-pad-len (if do-left-pad
(if do-right-pad
(- miss (quotient miss 2))
miss)
0))
(right-pad-len (- miss left-pad-len))
(left-pad (make-string left-pad-len #\space))
(right-pad (make-string right-pad-len #\space)))
(string-append left-pad line1 right-pad))
line1)))
;; Pads all lines of this cell to required width