summaryrefslogtreecommitdiff
path: root/lisp/ledger-fontify.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-12-01 19:31:56 -0700
committerCraig Earls <enderw88@gmail.com>2014-12-01 19:31:56 -0700
commit8f9c46d42b4f0e87805f46de81a11c5f31f85c12 (patch)
tree38180cb324660b7a4b453304e21e0326794e7d12 /lisp/ledger-fontify.el
parent3988de14bb3bc053de9f3dddcfa1356555913a5e (diff)
parent07324cb6b235cf2cbea6045575c1f3b095cc6123 (diff)
downloadfork-ledger-8f9c46d42b4f0e87805f46de81a11c5f31f85c12.tar.gz
fork-ledger-8f9c46d42b4f0e87805f46de81a11c5f31f85c12.tar.bz2
fork-ledger-8f9c46d42b4f0e87805f46de81a11c5f31f85c12.zip
Merge branch 'master' into ledger-mode-code-cleanup
Diffstat (limited to 'lisp/ledger-fontify.el')
-rw-r--r--lisp/ledger-fontify.el29
1 files changed, 15 insertions, 14 deletions
diff --git a/lisp/ledger-fontify.el b/lisp/ledger-fontify.el
index caf7690a..7d3c3e21 100644
--- a/lisp/ledger-fontify.el
+++ b/lisp/ledger-fontify.el
@@ -79,20 +79,21 @@
Fontify the first line of an xact"
(goto-char pos)
(beginning-of-line)
- (let ((state nil))
- (re-search-forward ledger-xact-start-regex)
- (ledger-fontify-set-face (list (match-beginning 1) (match-end 1)) 'ledger-font-posting-date-face)
- (save-match-data (setq state (ledger-state-from-string (match-string 5))))
- (ledger-fontify-set-face (list (match-beginning 7) (match-end 7))
- (cond ((eq state 'pending)
- 'ledger-font-payee-pending-face)
- ((eq state 'cleared)
- 'ledger-font-payee-cleared-face)
- (t
- 'ledger-font-payee-uncleared-face)))
- (ledger-fontify-set-face (list (match-beginning 8)
- (match-end 8)) 'ledger-font-comment-face)))
-
+ (let ((state nil)
+ (cur-point (point)))
+ (re-search-forward " ")
+ (ledger-fontify-set-face (list cur-point (point)) 'ledger-font-posting-date-face)
+ (re-search-forward ledger-xact-after-date-regex)
+ (save-match-data (setq state (ledger-state-from-string (match-string 1)))
+ (ledger-fontify-set-face (list (match-beginning 3) (match-end 3))
+ (cond ((eq state 'pending)
+ 'ledger-font-payee-pending-face)
+ ((eq state 'cleared)
+ 'ledger-font-payee-cleared-face)
+ (t
+ 'ledger-font-payee-uncleared-face))))
+ (ledger-fontify-set-face (list (match-beginning 4)
+ (match-end 4)) 'ledger-font-comment-face)))
(defun ledger-fontify-posting (pos)
(let* ((state nil)