From 6f3dad2024bb33c13dbb029b2127e2a23da86e35 Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Fri, 7 Nov 2014 18:56:11 -0700 Subject: Detect the beginning of periodic transactions properly. --- lisp/ledger-navigate.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp/ledger-navigate.el') diff --git a/lisp/ledger-navigate.el b/lisp/ledger-navigate.el index 1843430a..2759d2df 100644 --- a/lisp/ledger-navigate.el +++ b/lisp/ledger-navigate.el @@ -64,9 +64,10 @@ beginning with whitespace" (interactive) ;; need to start at the beginning of a line incase we are in the first line of an xact already. (beginning-of-line) - (unless (looking-at ledger-xact-start-regex) - (re-search-backward ledger-xact-start-regex nil t) - (beginning-of-line)) + (let ((sreg (concat "\\(~\\|" ledger-iso-date-regexp "\\)"))) + (unless (looking-at sreg) + (re-search-backward sreg nil t) + (beginning-of-line))) (point)) (defun ledger-navigate-end-of-xact () @@ -104,7 +105,7 @@ Requires empty line separating xacts." (save-excursion (goto-char pos) (beginning-of-line) - (if (looking-at "[ 0-9]") + (if (looking-at "[ ~0-9]") (ledger-navigate-find-xact-extents pos) (ledger-navigate-find-directive-extents pos)))) ;;; ledger-navigate.el ends here -- cgit v1.2.3