                      :truncator :black}
         type->bg-color {:truncator :white}]
     (merge token
-           (when-let [color (type->color (:type token))]
+           (when-let [color (type->color (tkn->simple-type token))]
              {:fg-color color})
-           (when-let [color (type->bg-color (:type token))]
+           (when-let [color (type->bg-color (tkn->simple-type token))]
              {:bg-color color}))))
 
 (defn mk-text-props

        {:keys [start start-line]} n']
    (when (and start start-line)
      (-> start
          (+ start-line)
          inc))))

(defn find-up-node
  [z]
  (let [up (some-> z z/up z/node)]
    (if (= (:type up) :map-entry)
      (some-> z z/up z/up z/node)
      up)))

(defn find-out-node
  [z]
  (let [up (some-> z z/up z/node)]
    (if (= (:type up) :map-entry)
      (some-> z z/up z/up z/node)
      up)))

(defn find-in-node
  [z]
  (let [down (some-> z z/down z/node)]
    (if (= (:type down) :map-entry)
      (some-> z z/down z/down z/right z/node)
      down)))

(defn find-prev-node
  [z]
  (let [up (some-> z z/up z/node)]
    (if (= (:type up) :map-entry)
      (some-> z z/up z/left z/down z/right z/node)
      (some-> z z/left z/node))))

(defn find-next-node
  [z]
  (let [up (some-> z z/up z/node)]
    (if (= (:type up) :map-entry)
      (some-> z z/up z/right z/down z/right z/node)
      (some-> z z/right z/node))))


       (remove #(-> % second nil?))
       (into {})))

(defn tkn->simple-type
  [t]
  (-> t :type first))

(defn apply-type-colors-to-token
  [token]
  (let [type->color {:int :cyan
