render-line now handles tab characters
This commit is contained in:
parent
7bda8d1a14
commit
d19d000021
|
@ -92,7 +92,7 @@
|
||||||
(defn- get-initial-output-lines [flf]
|
(defn- get-initial-output-lines [flf]
|
||||||
(take (get-in flf [:header :height]) (repeat "")))
|
(take (get-in flf [:header :height]) (repeat "")))
|
||||||
|
|
||||||
(defn- render-char [c flf lines]
|
(defn- render-char [^Character c flf lines]
|
||||||
(let [char-lines (get-in flf [:chars c])
|
(let [char-lines (get-in flf [:chars c])
|
||||||
hardblank (get-in flf [:header :hardblank-str])]
|
hardblank (get-in flf [:header :hardblank-str])]
|
||||||
(if char-lines
|
(if char-lines
|
||||||
|
@ -106,11 +106,13 @@
|
||||||
lines)
|
lines)
|
||||||
lines)))
|
lines)))
|
||||||
|
|
||||||
(defn render-line [s flf]
|
(defn render-line [^String s flf & [initial-output]]
|
||||||
(let [output (get-initial-output-lines flf)]
|
(let [output (or initial-output (get-initial-output-lines flf))]
|
||||||
(reduce
|
(reduce
|
||||||
(fn [out c]
|
(fn [out c]
|
||||||
(render-char c flf out))
|
(condp = c
|
||||||
|
\tab (render-line " " flf out)
|
||||||
|
(render-char c flf out)))
|
||||||
output
|
output
|
||||||
s)))
|
s)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue