           (.setCursor cm (.-line cur) (inc (.-ch cur))))
       (.operation cm
                        (fn []
-                           (.replaceRange cm pair cur)
-                           ; CHANGED: use aget instead of -line
-                           (.setCursor cm (aget cur "line") (inc (aget cur "ch")))
-                           (.indentLine cm (aget cur "line")))))))
+                         (.replaceRange cm pair cur)
+                         ; Using aget instead of -line because (.-line cur) was returning nil
+                         (.setCursor cm (aget cur "line") (inc (aget cur "ch")))
+                         (.indentLine cm (aget cur "line")))))))
 
 (defn ^:export forward-delete [cm]
   (if (nothing-selected? cm)

          e2  (.posFromIndex cm (inc i))
          s3  (.posFromIndex cm (- i 2))
          e3  e1]

      (condp = act
        1 (.replaceRange cm "" s1 e1)
        2 (.replaceRange cm "" s2 e2)
        3 (.replaceRange cm "" s3 e3)
        (.setCursor cm s1)))
    (.replaceSelection cm "")))


(ns subpar.core
  (:use [subpar.paredit :only [parse
                               in-string  ; takes string
                               in-string? ; takes parse output
                               forward-delete-action
