 	                 "(defun f (x)\n  |)"
 	                "; (Foo.|"
 	                 "; (Foo.)|"}]
-	    ["["         :paredit-open-square
+      ["["         :paredit-open-square
                  {"(a b |c d)"  "(a b [|] c d)"
                   "(foo \"bar |baz\" quux)" "(foo \"bar [|baz\" quux)"}
                   {"(a b|c d)" "(a b [|] c d)"

(defmulti paredit (fn [k & args] k))

(defn open-balanced
  [[o c] {:keys [text offset length] :as t}]
  #_(prn "t:" t)
  (if (in-code? text offset)
    (let [add-pre-space? (not (contains? (into *real-spaces* *open-brackets*) (previous-char t)))
          add-post-space? (not (contains? (into *extended-spaces* *close-brackets*) (next-char t)))
          ins-str (str (if add-pre-space? " " "")
                       (str o c)
                       (if add-post-space? " " ""))

  :paredit-open-round
  [cmd {:keys [text offset length] :as t}]
  #_(prn "t:" t)
  (open-balanced [\( \)] t 
    (into *real-spaces* *open-brackets*)
    (into *extended-spaces* *close-brackets*)))
    
(defmethod paredit 
  :paredit-open-square
  [cmd {:keys [text offset length] :as t}]
  #_(prn "t:" t)
  (open-balanced [\[ \]] t
    (into *real-spaces* *open-brackets*)
    (into *extended-spaces* *close-brackets*)))
    
(defmethod paredit 
  :paredit-open-curly
  [cmd {:keys [text offset length] :as t}]
  #_(prn "t:" t)
  (open-balanced [\{ \}] t
    (conj (into *real-spaces* *open-brackets*) \#) ; add # for not inserting space before a set
    (into *extended-spaces* *close-brackets*)))
    
(defn test-command [title-prefix command]
  (testing (str title-prefix " " (second command) " (\"" (first command) "\")")
