         sync! #(.setValue cm-output (infer/format-text (.getValue cm-input)))]
     (when cm-input
       (.on cm-input "change" sync!)
-      (sync!))
-    (when cm-input (.refresh cm-input))
-    (when cm-output (.refresh cm-output)))
+      (sync!)))
 
   (let [cm-input (create-regular-editor! "code-edit-input")
         cm-output (create-regular-editor! "code-edit-output" {:readOnly true

                                        "; ERROR: input must be balanced!"))]
    (when cm-input
      (.on cm-input "change" sync!)
      (sync!))
    (when cm-input (.refresh cm-input))
    (when cm-output (.refresh cm-output))))

(defn animate-when-visible!
  [key-]

  (create-editor! "code-string" :string)
  (create-editor! "code-enter" :enter)

  (let [opts {:readOnly true}]
    (create-editor! "code-warn-good" :warn-good opts)
    (create-editor! "code-warn-bad" :warn-bad opts))

  (create-editor! "code-displaced" :displaced)
  (create-editor! "code-not-displaced" :not-displaced)
