   [index-in-word word word-to-complete trim-chars]
   (let [partitioned-by-trimmed-chars (vec (utils/partition-by-regexp word trim-chars))
         index-of-part-to-complete (-> index-in-word
-                                          inc
-                                          (take word)
-                                          (utils/partition-by-regexp trim-chars)
-                                          count
-                                          dec)]
+                                      inc
+                                      (take word)
+                                      (utils/partition-by-regexp trim-chars)
+                                      count
+                                      dec)]
     (->> (update-in partitioned-by-trimmed-chars [index-of-part-to-complete]
                     #(str word-to-complete))
          (string/join ""))))

      ""
      current-word-item)))

(defn completions
  "Autocomplete options for word"
  [input dictionary options]
  (let [last-string (last (string/split input #" "))
        trim-chars (:trim-chars options)
        sort-fn (:sort-fn options)
        case-sensitive? (:case-sensitive? options)
        complete-items (items-to-complete case-sensitive? dictionary last-string)]
    (vec
     (if trim-chars
       (if (= (first last-string) (re-find (utils/str-to-pattern trim-chars) (str (first last-string))))
         (->> 1
              (subs last-string)
              (items-to-complete case-sensitive? dictionary)
              (sort-by sort-fn))
         (sort-by sort-fn complete-items))
       (sort-fn complete-items)))))

(defn words-to-index
  "Words to change index"



(defn case-sensitivity [case-sensitive? dictionary-item input]
  (if (= input "")
    nil
    (if case-sensitive?
      (string/starts-with? dictionary-item input)
      (string/starts-with? (string/lower-case dictionary-item) (string/lower-case input)))))

(defn items-to-complete
  "List of the items to autocomplete by given input and list of the all items"
