    (set-status {:type :clear})
    (.clearGutter @editor "CodeMirror-lint-markers")
    (c/run code (fn [res]
+                 (save-code update-url)
                  (cond (:error res) (set-status {:type :errors})
                        (not (empty? (:warnings res))) (set-status {:type :warnings})
                        :default (set-status {:type :ok}))

      :no-code (set "alert-warning" "no form found under cursor")
      :clear (set "" ""))))

(defn compile
  ([] (compile (.getValue @editor)))
  ([code]

                                            (.popover (j/$ "#share") "destroy")))
  (.on js/CodeMirror @editor "touchstart" #(do
                                            (hide-result-pane)
                                            (.popover (j/$ "#share") "destroy")))
  (.addEventListener js/window
                     "popstate"
                     (fn [event] (when-let [source (.-source (.-state event))]
                                   (set-editor-source source )))))


(j/$ init)
