commit 18a2c6b71bdf701b7140a68af5d980365972ed67 parent debb0a11ba21ccc9ba33e67e5089c5ba4f15c954 Author: Wilfred Hughes <me@wilfred.me.uk> Date: Sat, 22 Jul 2017 12:13:14 +0100 Align reference counts Diffstat:
| M | helpful.el | | | 13 | +++++++++---- |
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/helpful.el b/helpful.el @@ -373,12 +373,17 @@ E.g. (x x y z y) -> ((x . 2) (y . 2) (z . 1))" (push (cons item 1) counts))))) (defun helpful--format-reference (head ref-count position path) - (-let [(def name) head] + (-let* (((def name) head) + (formatted-def + (format "(%s %s ...)" def name)) + (padded-def + (s-pad-right 30 " " formatted-def)) + (formatted-count + (format "; %d reference%s" + ref-count (if (> ref-count 1) "s" "")))) (propertize (helpful--syntax-highlight - (format "(%s %s ...)\t; %d reference%s" - def name ref-count - (if (> ref-count 1) "s" ""))) + (format "%s %s" padded-def formatted-count)) 'helpful-path path 'helpful-pos position)))