FUEL: fix in table rendering, previously it cutted off some cells with to much text

db4
Björn Lindqvist 2014-10-21 23:20:47 +02:00
parent 465aa8786f
commit 8206adc2bb
1 changed files with 7 additions and 9 deletions

View File

@ -46,19 +46,17 @@
(mapcar #'(lambda (s) (fuel-table--pad-str s width))
(split-string (buffer-string) "\n"))))))
(defun fuel-table--pad-cell (lines max-ln)
(let* ((ln (length lines))
(blank (make-string (length (car lines)) ?\ ))
(n-extra (max (- max-ln ln) 0)))
(append lines (make-list n-extra blank))))
(defun fuel-table--pad-row (row)
(let* ((max-ln (apply 'max (mapcar 'length row)))
(result))
(dolist (lines row)
(let ((ln (length lines)))
(if (= ln max-ln) (push lines result)
(let ((lines (reverse lines))
(l 0)
(blank (make-string (length (car lines)) ?\ )))
(while (< l ln)
(push blank lines)
(setq l (1+ l)))
(push (reverse lines) result)))))
(push (fuel-table--pad-cell lines max-ln) result))
(reverse result)))
(defun fuel-table--format-rows (rows widths)