         scroller-element (.getScrollerElement @editor)]
     (set-style! scroller-element "width" (str container-width "px"))
     (set-style! scroller-element "height" (str container-height "px"))
-    (.refresh @editor)))
+    (swap! editor #(.refresh %))))
 
 (defn new-editor []
   (js/CodeMirror (by-id "editor") 

(defn cut-func []
  (do
    (.set clipboard (.getSelection @editor))
    (.replaceSelection @editor "")))

(defn paste-func []
  (.replaceSelection @editor (.get clipboard)))

  (if false
    (do
      (new-file)
      (swap! editor #(.setValue % "")))
    (let [x (+ 10 (.-screenX js/window))
          y (+ 10 (.-screenY js/window))]
      (.open js/window "main.html" "_blank" 
