1
0
Fork 0

- [GUI] improved formatting of TOC entries.

This commit is contained in:
cage 2023-05-20 20:02:11 +02:00
parent 95e9e2a9c3
commit 14525c2f1b
1 changed files with 9 additions and 12 deletions

View File

@ -453,18 +453,15 @@
(longest-number (find-longest-string toc-numbers))
(max-number-length (length longest-number))
(max-non-padded-text-size (+ max-text-length max-number-length))
(toc-entries-text (loop for text in toc-text
for number in toc-numbers
collect
(let* ((text-length (+ (length text)
(length number)))
(padding-size (- max-non-padded-text-size
text-length))
(padding (make-string padding-size
:initial-element (swconf:gemini-toc-padding-char))))
(strcat number
padding
text)))))
(toc-entries-text
(loop for text in toc-text
for number in toc-numbers
collect
(let* ((prefix (right-padding number
max-number-length
:padding-char
(swconf:gemini-toc-padding-char))))
(strcat prefix text)))))
(values
(loop for toc-entry in toc
for text in toc-entries-text