From 90534fb647995731ff6f4aa40d013ebfe603f31f Mon Sep 17 00:00:00 2001 From: bhrgunatha Date: Thu, 27 Jan 2022 17:05:51 +0800 Subject: [PATCH] Add a face for careful keywords that support dark and light themes --- v-mode.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/v-mode.el b/v-mode.el index a31b817..d95dcfb 100644 --- a/v-mode.el +++ b/v-mode.el @@ -133,6 +133,14 @@ :type '(repeat string) :group 'v-mode) +(defface v-mode-careful-keywords-face + '((((background light)) :inherit font-lock-keyword-face :weight thin :slant italic :background "#d8d8d8") + (((background dark)) :inherit font-lock-keyword-face :weight thin :slant italic :background "#404040")) + "Face `v-mode' uses to highlight keywords that need careful use." + :tag "V Careful Keywords" + :group 'v-mode) +(defvar v-mode-careful-keywords-face 'v-mode-careful-keywords-face) + (defcustom v-builtin-keywords '("string" "bool" ; "i8" "i16" "int" "i64" "i128" ; @@ -194,8 +202,8 @@ ;; builtin (,v-builtin-keywords-regexp . font-lock-builtin-face) - ;; careful - (,v-careful-keywords-regexp . font-lock-warning-face) + ;; ;; careful + (,v-careful-keywords-regexp . v-mode-careful-keywords-face) ;; @ # $ ;; ("#\\(?:include\\|flag\\)" . 'font-lock-builtin-face)