    :-display-code
    (fn [{:keys [refs props locals]}]
      (let [{:keys [mode line-numbers? read-only? text]} props]
-       (swap! locals assoc :code-mirror-instance
-              (@codemirror-instance (react/find-dom-node (@refs "container"))
+       (swap! locals assoc :codemirror-instance
+              (@codemirror-constructor (react/find-dom-node (@refs "container"))
                (clj->js
                 (merge
                  (when text {:value text})

   [broadfcui.utils :as utils]
   ))

(defonce ^:private codemirror-instance (atom false))

(defn- regex-escape [s]
  (clojure.string/replace s #"[\\\*\+\|\^]" #(str "\\" %)))

          (not loaded?) [ScriptLoader
                         {:on-error #(swap! state assoc :error? true)
                          :on-load (fn []
                                     (when-not @codemirror-constructor
                                       (reset! codemirror-constructor (aget js/window "webpackDeps" "CodeMirror"))
                                       (define-wdl))
                                     (this :-display-code)
                                     (when-let [init (:initialize props)]
