Load messages and handle table string with single tab inside.

This commit is contained in:
Dominik Pantůček 2023-03-31 09:37:08 +02:00
parent 3edfe6c02a
commit b72f1900e6
4 changed files with 17 additions and 6 deletions

View file

@ -139,9 +139,12 @@
;; Normalizes cell line to required width and handles leading and
;; trailing tabs to allow for right and center alignment.
(define (table-normalize-cell-line line w)
(print "tncl " w " \"" line "\"")
(let* ((lst (string->list line))
(first-char (if (null? lst) #f (car lst)))
(last-char (if (null? lst) #f (car (reverse lst))))
(last-char (if (or (null? lst)
(null? (cdr lst)))
#f (car (reverse lst))))
(first-tab (eq? first-char #\tab))
(last-tab (eq? last-char #\tab))
(line0 (if first-tab (substring line 1) line))