    [broadfcui.utils :as utils]
    ))
 
-(defonce ^:private codemirror-instance (atom false))
+(defonce ^:private codemirror-constructor (atom false))
 
 (defn- regex-escape [s]
   (clojure.string/replace s #"[\\\*\+\|\^]" #(str "\\" %)))

   :-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"))
               (clj->js
                (merge
                 (when text {:value text})

          (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)]
