               (if (search-forward "  " (line-end-position) t)
                   (insert (make-string width ? ))))))
         (forward-line)
+	;; Shift the cleared/pending status to the postings
         (while (looking-at "[ \t]")
           (skip-chars-forward " \t")
-          (insert (ledger-char-from-state cur-status) " ")
-          (if (search-forward "  " (line-end-position) t)
-              (delete-char 2))
-          (forward-line))
+	  (when (not (eq (ledger-state-from-char (char-after)) 'comment))
+	    (insert (ledger-char-from-state cur-status) " ")
+	    (if (search-forward "  " (line-end-position) t)
+		(delete-char 2)))
+	  (forward-line))
 	(setq new-status nil)))
 
-    ;;this excursion marks the posting pending or cleared
+    ;;this excursion toggles the posting status
     (save-excursion
       (goto-char (line-beginning-position))
       (when (looking-at "[ \t]")

	 'pending)
	((eql state-char ?\*)
	 'cleared)
	(t
	 nil)))


        (while (and (not hetero) (looking-at "[ \t]"))
          (skip-chars-forward " \t")
          (let ((cur-status (ledger-state-from-char (char-after))))
	    (if (not (eq cur-status 'comment))
		(if first
		    (setq state cur-status
			  first nil)
		    (if (not (eq state cur-status))
			(setq hetero t)))))
          (forward-line))
        (when (and (not hetero) (not (eq state nil)))
          (goto-char (car bounds))
