         other-items (sort (vec (clojure.set/difference (set items-to-sort) (set lower-case-items))))]
     (apply conj other-items (reverse lower-case-items))))
 
+(defn sort-dictionary [dictionary]
+  (->> dictionary
+       sort-case-insensitive-way
+       lower-case-first))
+
 (defn create-dictionary [event console-key]
   (let [previous-input (subscribe [:get-previous-input console-key])
         options (subscribe [:get-options console-key])

                     (opening-excluded-chars trim-chars)
                     (closing-excluded-chars trim-chars))
        user-ns (keys (replumb.ast/ns-publics @replumb.repl.st 'cljs.user))
        requires (get-in @replumb.repl.st [:cljs.analyzer/namespaces 'cljs.user :requires])
        cljs-user (get-functions-from-ns 'cljs.user)
        cljs-core (get-functions-from-ns 'cljs.core)
        base-libs (concat cljs-user cljs-core)]
    (if (= new-text "")
      ""
      (dispatch [:dictionary console-key (->> (map (fn [[k v]]
                                                     (map #(str k "/" %) (keys (ast/ns-publics @replumb.repl.st v))))
                                                   requires)
                                              (map str)
                                              (apply concat)
                                              sort-case-insensitive-way
                                              (concat base-libs)
                                              lower-case-first)]))))

            [re-frame.core :refer [dispatch subscribe]]
            [re-complete.app :as complete-app]
            [replumb.ast :as ast]
            [clojure.string :as str]
            [replumb.ast :as ast]))

(defn gist-showing?
  "Given a db, indicates if the gist login dialog is shown.
