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

  [title]
  (let [title (set-title title)
        [mode mode-name] (get-mode title)]
    (.setOption @editor "mode" mode)
    (aset (by-id "mode") "innerHTML" mode-name)))

;; file functions -------------------------------------------------------------

        scroller-element (.getScrollerElement @editor)]
    (set-style! scroller-element "width" (str container-width "px"))
    (set-style! scroller-element "height" (str container-height "px"))
    (swap! editor #(.refresh %))))

(defn new-editor []
  (js/CodeMirror (by-id "editor") 
