Detect the beginning of periodic transactions properly.

This commit is contained in:
Craig Earls 2014-11-07 18:56:11 -07:00
parent af15887ecb
commit 6f3dad2024

View file

@ -64,9 +64,10 @@ beginning with whitespace"
(interactive) (interactive)
;; need to start at the beginning of a line incase we are in the first line of an xact already. ;; need to start at the beginning of a line incase we are in the first line of an xact already.
(beginning-of-line) (beginning-of-line)
(unless (looking-at ledger-xact-start-regex) (let ((sreg (concat "\\(~\\|" ledger-iso-date-regexp "\\)")))
(re-search-backward ledger-xact-start-regex nil t) (unless (looking-at sreg)
(beginning-of-line)) (re-search-backward sreg nil t)
(beginning-of-line)))
(point)) (point))
(defun ledger-navigate-end-of-xact () (defun ledger-navigate-end-of-xact ()
@ -104,7 +105,7 @@ Requires empty line separating xacts."
(save-excursion (save-excursion
(goto-char pos) (goto-char pos)
(beginning-of-line) (beginning-of-line)
(if (looking-at "[ 0-9]") (if (looking-at "[ ~0-9]")
(ledger-navigate-find-xact-extents pos) (ledger-navigate-find-xact-extents pos)
(ledger-navigate-find-directive-extents pos)))) (ledger-navigate-find-directive-extents pos))))
;;; ledger-navigate.el ends here ;;; ledger-navigate.el ends here