 (ns ^:figwheel-always parinfer.core
   (:require
-    [clojure.string :as string :refer [split-lines]]
+    [clojure.string :as string :refer [split-lines join]]
     [om.core :as om :include-macros true]
     [om.dom :as dom :include-macros true]
     [sablono.core :refer-macros [html]]))

(defn update-text!
  [cursor-index text]
  (try
    (let [stack (parse-text text)]
      (swap! app-state assoc :stack stack)
      (swap! app-state assoc :text text))
    (catch :default e
      (println "EXCEPTION:" e)
      nil ;; don't update the text

                          (update-text! (.-selectionStart target) (.-value target))))
           :value (:text data)}]
         [:pre.internal
          (:text data)]
         [:pre.computed
          (:full-text data)]]))))

(om/root
  root-comp
