summaryrefslogtreecommitdiff
path: root/ledger-sort.el
diff options
context:
space:
mode:
authorSteve Purcell <steve@sanityinc.com>2014-12-09 14:40:39 +0000
committerSteve Purcell <steve@sanityinc.com>2014-12-09 14:40:39 +0000
commit1bad05caffcb98486cb7917c8e559239f84fd571 (patch)
tree4f9bf1ff50925c62368efda1b801d0da8c7a6398 /ledger-sort.el
parentcd15553a61a99af5561e5fafb011e489e0445319 (diff)
[emacs] When the first line is a txn, include it in ledger-sort-buffer
Without this fix, ledger-sort-region tends to skip the first transaction when sorting a region or the entire buffer.
Diffstat (limited to 'ledger-sort.el')
-rw-r--r--ledger-sort.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/ledger-sort.el b/ledger-sort.el
index 534d3b2..23cfbae 100644
--- a/ledger-sort.el
+++ b/ledger-sort.el
@@ -79,6 +79,8 @@
(goto-char beg)
;; make sure point is at the beginning of a xact
(ledger-navigate-next-xact)
+ (unless (looking-at ledger-payee-any-status-regex)
+ (ledger-navigate-next-xact))
(setq new-beg (point))
(goto-char end)
(ledger-navigate-next-xact)