summaryrefslogtreecommitdiff
path: root/lisp/ledger-fontify.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-11-07 18:19:57 -0700
committerCraig Earls <enderw88@gmail.com>2014-11-07 18:19:57 -0700
commit1bd67755fa3127d80b7534d15f1f9de1b477c19a (patch)
tree7173c72aac2eed11a1315c903efe09ea3039ca04 /lisp/ledger-fontify.el
parenta66001382cd68c1d989bbe4ced629cc87370a4ce (diff)
downloadledger-1bd67755fa3127d80b7534d15f1f9de1b477c19a.tar.gz
ledger-1bd67755fa3127d80b7534d15f1f9de1b477c19a.tar.bz2
ledger-1bd67755fa3127d80b7534d15f1f9de1b477c19a.zip
Improve finding boundaries of elements for fontification. Also added P for price directives.
Diffstat (limited to 'lisp/ledger-fontify.el')
-rw-r--r--lisp/ledger-fontify.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/ledger-fontify.el b/lisp/ledger-fontify.el
index 45baa433..d876e5e3 100644
--- a/lisp/ledger-fontify.el
+++ b/lisp/ledger-fontify.el
@@ -52,7 +52,7 @@
(interactive "d")
(save-excursion
(goto-char position)
- (let ((extents (ledger-navigate-find-xact-extents position))
+ (let ((extents (ledger-navigate-find-element-extents position))
(state (ledger-transaction-state)))
(if (and ledger-fontify-xact-state-overrides state)
(cond ((eq state 'cleared)
@@ -115,7 +115,7 @@ Fontify the first line of an xact"
'ledger-font-comment-face)))
(defun ledger-fontify-directive-at (position)
- (let ((extents (ledger-navigate-find-xact-extents position))
+ (let ((extents (ledger-navigate-find-element-extents position))
(face 'ledger-font-default-face))
(cond ((looking-at "=")
(setq face 'ledger-font-auto-xact-face))
@@ -153,6 +153,8 @@ Fontify the first line of an xact"
(setq face 'ledger-font-include-directive-face))
((looking-at "payee")
(setq face 'ledger-font-payee-directive-face))
+ ((looking-at "P")
+ (setq face 'ledger-font-price-directive-face))
((looking-at "tag")
(setq face 'ledger-font-tag-directive-face)))
(ledger-fontify-set-face extents face)))