                   :line-no line-no
                   :removed-delims [])
          state (update-in state [:insert :line-dy] #(when % (dec %)))
-         state (reduce process-char state (str line "\n"))
-         state (-> state
-                   block-delim-trail
-                   remove-delim-trail
-                   save-preinsert-line
-                   (commit-cached-state :postline-states))
-
-         ;; if this did not have an indentation trigger point,
-         ;; pad postindent-states with a nil.
-         state (cond-> state
-                 (not (:processed-indent? state))
-                 (update :postindent-states conj nil))]
-     state)))
+
+         state (reduce process-char state (str line "\n"))]
+     (if (:quit? state)
+       (reduced state)
+       (postprocess-line state)))))
 
 (defn finalize-state
   [{:keys [stack quote-danger?] :as state}]

  (let [x-pos (count (get lines line-no))
        state (assoc state :x-pos x-pos :ch (str ch))
        state (process-indent state)]
    (cond-> state
      (:process? state) process-char*)))

(defn process-line
  "Update the state by processing the given line of text."
  ([line] (process-line initial-state line))
  ([{:keys [stack lines line-no cursor-line] :as state} line]
   (let [line-no (inc line-no)
         state (assoc state
                  :backup []
                  :cursor-in-comment? false

                        (in-code? stack)
                        (not (whitespace? ch))
                        (not= ";" ch))
        skip?       (and check-indent? (closing-delim? ch))
        at-indent?  (and check-indent? (not skip?))
        quit?       (and at-indent? quote-danger?)
        state (assoc state
                     :quit? quit?
                     :process? (and (not skip?) (not quit?)))]
    (cond-> state
      (and at-indent? (not quit?)) process-indent-trigger)))

(defn update-line
  "Update the state by adding processed character to the line."
