diff options
author | Craig Earls <enderw88@gmail.com> | 2014-11-15 21:36:34 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-11-15 21:36:34 -0700 |
commit | db7e4fd741021bec72121f915414679d30144735 (patch) | |
tree | e6b220db5a00cc0e3adf8add8a8825b9c152cc67 /lisp/ledger-navigate.el | |
parent | 4dbc822f90e4f8c3a2842846ba6b7b4695fe1d21 (diff) | |
download | ledger-db7e4fd741021bec72121f915414679d30144735.tar.gz ledger-db7e4fd741021bec72121f915414679d30144735.tar.bz2 ledger-db7e4fd741021bec72121f915414679d30144735.zip |
Fix minor navigation bugs. Prev and next act now properly handle directives and empty lines
Diffstat (limited to 'lisp/ledger-navigate.el')
-rw-r--r-- | lisp/ledger-navigate.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ledger-navigate.el b/lisp/ledger-navigate.el index 5da5cf8d..d954222f 100644 --- a/lisp/ledger-navigate.el +++ b/lisp/ledger-navigate.el @@ -54,11 +54,14 @@ beginning with whitespace" (ledger-navigate-start-xact-or-directive-p))) (forward-line)))) -(defun ledger-navigate-prev-xact () +(defun ledger-navigate-prev-xact-or-directive () "Move point to beginning of previous xact." (interactive) - (ledger-navigate-beginning-of-xact) - (re-search-backward ledger-xact-start-regex nil t)) + (let ((context (car (ledger-context-at-point)))) + (when (equal context 'acct-transaction) + (ledger-navigate-beginning-of-xact)) + (beginning-of-line) + (re-search-backward "^[[:graph:]]" nil t))) (defun ledger-navigate-beginning-of-xact () "Move point to the beginning of the current xact" @@ -75,7 +78,7 @@ beginning with whitespace" "Move point to end of xact." (interactive) (ledger-navigate-next-xact-or-directive) - (backward-char) + (re-search-backward "^[ \t]") (end-of-line) (point)) |