FUEL: fix in table rendering, previously it cutted off some cells with to much text
parent
465aa8786f
commit
8206adc2bb
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue