 
 (def frame-updates (atom {}))
 
-(defn selection [cm] (.getSelections cm (.listSelections cm)))
+(defn selection [cm]
+  (map (fn [s]
+         (clojure.string/replace
+                 s
+                 "[object Object]" ""))
+       (.getSelections cm (.listSelections cm))))
 
 (defn before-change
   "Called before any change is applied to the editor."

      (.setCursor cm (aget cursor "line") new-cursor-x))
    (.scrollTo cm scroll-x scroll-y)))

#_(defn render-demo! []
    (create-editor! "code-demo" :demo)
    (editor-ui/render! :demo)
    (start-editor-sync!)
    (swap! editor-state assoc-in [:demo :text] demo-example))


;;----------------------------------------------------------------------
;; Life Cycle events
;;----------------------------------------------------------------------

       (.on cm "beforeChange" before-change)
       (.on cm "cursorActivity" on-cursor-activity)

       (.addKeyMap cm #js {"Ctrl-Enter" (fn [cm] (evaluate (cm-selection-or-form cm)))})

       cm))))

