                               (s/button :id :doc-button
                                         :text (utils/get-string :doc)
                                         :focusable? false
-                                        :visible? (not (nil? completion))
-                                        :listen [:action run-completion])
+                                        :visible? (not (nil? completer))
+                                        :listen [:action do-completion-fn])
                               (s/toggle :id :paredit-button
                                         :text (utils/get-string :paredit)
                                         :focusable? false

    ; anything else
    :else nil))

(defn install-completion
  [text-area provider]
  (doto (AutoCompletion. provider)
    (.setShowDescWindow true)
    (.setAutoCompleteSingleChoices false)
    (.setChoicesWindowSize 150 300)
    (.setDescriptionWindowSize 300 300)
    (.install text-area)))

(defn create-editor
  [path extension]

    (let [is-clojure? (contains? clojure-exts extension)
          text-area (get-text-area)
          toggle-paredit-fn (when is-clojure? (paredit/get-toggle-fn text-area))
          completer (get-completer text-area extension)
          do-completion-fn (fn [_]
                             (s/request-focus! text-area)
                             (when completer (.doCompletion completer)))
          btn-group (ui/wrap-panel
                      :items [(s/button :id :save-button
                                        :text (utils/get-string :save)
