fix: improve and add faces

This commit is contained in:
Lucas Sta Maria 2025-08-23 22:50:20 +08:00
parent 5b47adb978
commit cb7ec6ff4c
Signed by: lucas
GPG key ID: F07FB16A826E3B47

View file

@ -37,15 +37,25 @@
(require 'ghpr-utils) (require 'ghpr-utils)
(defface ghpr-review-added-line (defface ghpr-review-added-line
'((t (:background "green" :foreground "black"))) '((t (:inherit diff-indicator-added)))
"Face for added lines in PR diff." "Face for added lines in PR diff."
:group 'ghpr) :group 'ghpr)
(defface ghpr-review-removed-line (defface ghpr-review-removed-line
'((t (:background "red" :foreground "black"))) '((t (:inherit diff-indicator-removed)))
"Face for removed lines in PR diff." "Face for removed lines in PR diff."
:group 'ghpr) :group 'ghpr)
(defface ghpr-review-existing-review
'((t (:foreground "purple")))
"Face for existing review comments."
:group 'ghpr)
(defface ghpr-review-misc-line
'((t (:inherit diff-header)))
"Face for miscellaneous lines in PR diff."
:group 'ghpr)
(defvar ghpr-review-font-lock-keywords (defvar ghpr-review-font-lock-keywords
'(("^\\(> \\+[^+]\\)\\(.*\\)$" '(("^\\(> \\+[^+]\\)\\(.*\\)$"
(0 'ghpr-review-added-line t)) (0 'ghpr-review-added-line t))
@ -54,7 +64,11 @@
("^\\(> -[^-]\\)\\(.*\\)$" ("^\\(> -[^-]\\)\\(.*\\)$"
(0 'ghpr-review-removed-line t)) (0 'ghpr-review-removed-line t))
("^\\(> -\\)$" ; Handle line with just "> -" ("^\\(> -\\)$" ; Handle line with just "> -"
(0 'ghpr-review-removed-line t))) (0 'ghpr-review-removed-line t))
("^<.*$"
(0 'ghpr-review-existing-review t))
("^>.*$"
(0 'ghpr-review-misc-line)))
"Font lock keywords for ghpr-review-mode.") "Font lock keywords for ghpr-review-mode.")
(defvar-local ghpr-review-diff-content nil (defvar-local ghpr-review-diff-content nil