        (str-contains? t "comment") true
        (and (str-contains? t "string")
             (not
-             (and (end-pair? ch) (= \" left-ch) (not (= "string"
-                                                        (editor/->token-type ed (editor/adjust-loc loc 1))))))) true
+             (and (end-pair? ch) (= \" left-ch) (not (= "string" (editor/->token-type ed (editor/adjust-loc loc 1))))))) true
        :else false))))
 
 

                               (max (dec (editor/line-length ed (:line neue))) 0)
                               0))))))

(defn move-loc [ed dir loc]
  (when loc
    (let [len (editor/line-length ed (:line loc))
          neue (editor/adjust-loc loc (if (= dir :left) -1 1))]
      (cond
       (< (:ch neue) 0) (move-loc-line ed loc :up)
       (>= (:ch neue) len) (move-loc-line ed loc :down)
       :else neue))))

(defn peek-ch [ed dir loc]
  (when-let [next-loc (move-loc ed dir loc)]
    (get-ch ed next-loc)))

(defn within-range [[start end] cur]
  (>= end (:line cur) start))


(defn loc-next-end-pair [ed loc]

              (not (within-range search-range cur)))
        nil
        (let [ch (get line (:ch cur))
              next-loc (move-loc ed :right cur :line line)
              next-line (if (not= (:line cur) (:line next-loc))
                          (editor/line ed (:line next-loc))
                          line)]
          (cond
           (not (or (start-pair? ch) (end-pair? ch))) (recur next-loc next-line level)
           (string|comment? ed cur) (recur next-loc next-line level)
           (start-pair? ch) (recur next-loc next-line (inc level))
           (and (end-pair? ch) (= 0 level)) cur
           (end-pair? ch) (recur next-loc next-line (dec level))
