         editor  (reset! editor (js/CodeMirror.fromTextArea element cm-opts))]
     (.setValue editor text)
     (when on-change
-      (.on editor "change" on-change))
-    (when on-key-down
-      (.on editor "keydown" on-key-down))))
+      (.on editor "change" on-change))))
 
 (defn cm-will-update [node editor [_ _ text]]
   (debugf "Update")

      js/CodeMirror.Pass
      (f cm))))

(defn editor [props value]
  (let [history-next (make-history-next props)
        history-prev (make-history-prev props)
        submit       (make-submit props)
        extra-keys   {:Up         (-> history-prev wrap-ignore-multi)
                      :Down       (-> history-next wrap-ignore-multi)
                      :Ctrl-Up    history-prev
                      :Ctrl-Down  history-next
                      :Enter      (-> submit wrap-ignore-multi)
                      :Ctrl-Enter submit}]
    (fn []
      [codemirror
       {:editable?  true
        :numbers?   false
        :focus?     true
        :extra-keys extra-keys}
       value])))

(defn code [text]
  [codemirror {:read-only? true :mode "clojure"} text])

    true)
  (reset! editor nil))

(defn cm-render [props text]
  [:textarea {:value text :read-only true}])

(defn codemirror [props text]
