Better end testing for align-postings

This commit is contained in:
Craig Earls 2013-03-26 23:50:14 -04:00
parent 5b1778b3ca
commit 5418e77c63

View file

@ -181,9 +181,9 @@ region align the posting on the current line."
(line-beginning-position))) (line-beginning-position)))
;; This is the guts of the alignment loop ;; This is the guts of the alignment loop
(while (or (setq acc-col (ledger-next-account (line-end-position))) (while (and (or (setq acc-col (ledger-next-account (line-end-position)))
(and (< (point) end-region) lines-left)
lines-left)) (< (point) end-region))
(when acc-col (when acc-col
(if (/= (setq acc-adjust (- ledger-post-account-alignment-column acc-col)) 0) (if (/= (setq acc-adjust (- ledger-post-account-alignment-column acc-col)) 0)
(ledger-post-adjust acc-adjust)) (ledger-post-adjust acc-adjust))