         max-height (->> lines
                         (map count)
                         (apply max))
+        lines' (map #(take max-height (concat % (repeat []))) lines)
         widths (map #(->> %
                           (map get-line-length)
                           (apply max)


(defn get-line-length
  [line]
  (def l' line)
  (->> line (map :length) (apply +)))

(defn buffer-lines-to-width
  [width column]
  (def w' width)
  (def c' column)
  (map (fn [line]
         (let [buf-length (->> line (map :length) (apply +) (- width))]
           (if (> buf-length 0)


(defn assoc-tokens-pos
  [tokens]
  (loop [[{:keys [length line-break line-meta?] :as head} & tail] tokens
         line-meta nil
         pos 0
