 (defprotocol IEditor
   "Custom data/methods for a CodeMirror editor."
   (cm-key [this])
+  (get-prev-state [this])
   (frame-updated? [this])
   (set-frame-updated! [this value])
   (record-change! [this thing]))

                      (+ len-last-line (.. change -from -ch)))]
          (- end-x start-x))))))

 
(defn fix-text!
  "Correctly format the text from the given editor."

           wrapper (.getWrapperElement cm)
           watcher (js/scrollMonitor.create wrapper)
           initial-state (assoc empty-editor-state
                                :mode (:parinfer-mode opts))
           prev-editor-state (atom nil)]


       (set! (.-id wrapper) (str "cm-" element-id))
