aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-16 21:55:17 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-22 10:46:41 -0200
commit8dc020031b0472d8fc5b50037fcc257422f7544f (patch)
tree63f181e1653baa8f0437f4ee49fb0d222e3f09b3
parent9907fb614e0a687a5823519aaa2ae06df12d3dfe (diff)
Display comment score
-rw-r--r--sx-question-print.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/sx-question-print.el b/sx-question-print.el
index 0e90c51..e2e171b 100644
--- a/sx-question-print.el
+++ b/sx-question-print.el
@@ -291,17 +291,20 @@ The comment is indented, filled, and then printed according to
(list 'sx--data-here comment-data)
(sx-assoc-let comment-data
(insert
+ (if (> .score 0) (number-to-string .score) "")
+ (if (eq .upvoted t) "^" "")
+ (if (or (> .score 0) .upvoted) " " "")
(format
- sx-question-mode-comments-format
- (sx-question-mode--propertize-display-name .owner)
- (substring
- ;; We fill with three spaces at the start, so the comment is
- ;; slightly indented.
- (sx-question-mode--fill-and-fontify
- (concat " " .body_markdown))
- ;; Then we remove the spaces from the first line, since we'll
- ;; add the username there anyway.
- 3))))))
+ sx-question-mode-comments-format
+ (sx-question-mode--propertize-display-name .owner)
+ (substring
+ ;; We fill with three spaces at the start, so the comment is
+ ;; slightly indented.
+ (sx-question-mode--fill-and-fontify
+ (concat " " .body_markdown))
+ ;; Then we remove the spaces from the first line, since we'll
+ ;; add the username there anyway.
+ 3))))))
(defun sx-question-mode--insert-header (&rest args)
"Insert propertized ARGS.