          [:select.mode
           {:value (name (:mode editor))
            :on-change (fn [e]
-                        (om/update! editor :mode (keyword (.. e -target -value))))}
+                        (om/update! editor :mode (keyword (.. e -target -value)))
+                        (refresh! (:cm editor)))}
           [:option {:value "indent-mode"} "Indent Mode"]
           [:option {:value "paren-mode"} "Paren Mode"]]
 

    [parinfer-site.state :refer [state]]
    [om.core :as om]
    [sablono.core :refer-macros [html]]
    ))

(defn editor-header
  [editor]

               {:type "checkbox"
                :checked (get-in editor path)
                :on-change (fn [e]
                             (om/update! editor path (.. e -target -checked))
                             (refresh! (:cm editor)))}]
              "preview cursor scope"]))

         (when (= (:mode editor) :paren-mode)
