branch: elpa/solarized-theme commit 5d136736f76c85a83fef737d10ecd32af4d493fd Author: Ilgiz Mustafin <imusta...@users.noreply.github.com> Commit: GitHub <nore...@github.com>
Add option to highlight numbers (#451) --- README.md | 3 +++ solarized-faces.el | 3 ++- solarized.el | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf6e5ffdef..4636092574 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ elisp code: (setq solarized-height-plus-3 1.0) (setq solarized-height-plus-4 1.0) +;; Highlight all numbers +(setq solarized-highlight-numbers t) + ``` Note that these need to be set **before** `load-theme` is invoked for Solarized. diff --git a/solarized-faces.el b/solarized-faces.el index 667400231a..917fa08fbb 100644 --- a/solarized-faces.el +++ b/solarized-faces.el @@ -236,6 +236,7 @@ ((,class (:foreground ,base01 :slant ,s-maybe-italic)))) `(font-lock-comment-face ((,class (:foreground ,base01)))) `(font-lock-constant-face ((,class (:foreground ,blue :weight bold)))) + `(font-lock-number-face ((,class (:foreground ,(if solarized-highlight-numbers violet 'unspecified))))) `(font-lock-doc-face ((,class (:foreground ,(if solarized-distinct-doc-face violet cyan) :slant ,s-maybe-italic)))) `(font-lock-function-name-face ((,class (:foreground ,blue)))) @@ -919,7 +920,7 @@ `(highlight-indentation-face ((,class (:background ,base02)))) `(highlight-indentation-current-column-face((,class (:background ,base02)))) ;;;;; highlight-numbers - `(highlight-numbers-number ((,class (:foreground ,violet :bold nil)))) + `(highlight-numbers-number ((,class (:inherit font-lock-number-face)))) ;;;;; highlight-symbol `(highlight-symbol-face ((,class (:foreground ,magenta)))) ;;;;; hl-line-mode diff --git a/solarized.el b/solarized.el index f0ed078f02..ddd796ac2f 100644 --- a/solarized.el +++ b/solarized.el @@ -52,6 +52,13 @@ Related discussion: https://github.com/bbatsov/solarized-emacs/issues/158" :type 'boolean :group 'solarized) +(defcustom solarized-highlight-numbers nil + "Highlight all numbers. +Applies color to `font-lock-number-face' and `highlight-numbers' mode. +Many tree-sitter based modes use `font-lock-number-face'." + :type 'boolean + :group 'solarized) + (defcustom solarized-use-variable-pitch t "Use variable pitch face for some headings and titles." :type 'boolean