         (paredit paredit-command
                  {:text (:text document-text)
                   :offset (if (= paredit-command :paredit-backward-delete) (inc (:offset command)) (:offset command))
-                  :length 1}))))
-
+                  :length 1}))
+    (and (par-command? command)
+         (one-char-par-command? command)) ; TODO enhance to also handle the replace of a bunch of text
+      (paredit (par-command command)
+               {:text (:text document-text) 
+                :offset (:offset command) 
+                :length (:length command)})))
 
 (defn paredit-enabled?
   [#^org.eclipse.jface.preference.IPreferenceStore prefs-store]

  [editor preference-store] [[] (ref {:editor editor :prefs-store preference-store})])   

; TODO move this into paredit itself ...
(def *one-char-command* 
  {"(" :paredit-open-round 
   "[" :paredit-open-square
   "{" :paredit-open-curly
   ")" :paredit-close-round
   "]" :paredit-close-square
   "}" :paredit-close-curly
   "\"" :paredit-doublequote
   "\t" :paredit-indent-line
   "\n" :paredit-newline
   })

(defn- call-paredit [command document-text]
  (cond
    (and (zero? (:length command)) ; TODO enhance to also handle the replace of a bunch of text
         (contains? *one-char-command* (:text command)))
      (paredit (get *one-char-command* (:text command))
               {:text (:text document-text) 
                :offset (:offset command) 
                :length 0})
    (and (zero? (-> command #^String (:text) .length))
         (= 1 (:length command)))
      (let [paredit-command (if (= (:offset command) (:caret-offset document-text)) 

            (set! (.text command) "")
            (set! (.doit command) false)))
        (set! (.shiftsCaret command) false)
        (set! (.caretOffset command) (:offset result))
        (when-not (zero? (:length result)) 
          (println (str "result:" result))
          (.selectAndReveal (-> this .state deref :editor) (:offset result) (:length result)))))))