Skip to content

Commit 5d13673

Browse files
authored
Add option to highlight numbers (#451)
1 parent ac09b78 commit 5d13673

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ elisp code:
106106
(setq solarized-height-plus-3 1.0)
107107
(setq solarized-height-plus-4 1.0)
108108
109+
;; Highlight all numbers
110+
(setq solarized-highlight-numbers t)
111+
109112
```
110113

111114
Note that these need to be set **before** `load-theme` is invoked for Solarized.

solarized-faces.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
((,class (:foreground ,base01 :slant ,s-maybe-italic))))
237237
`(font-lock-comment-face ((,class (:foreground ,base01))))
238238
`(font-lock-constant-face ((,class (:foreground ,blue :weight bold))))
239+
`(font-lock-number-face ((,class (:foreground ,(if solarized-highlight-numbers violet 'unspecified)))))
239240
`(font-lock-doc-face ((,class (:foreground ,(if solarized-distinct-doc-face violet cyan)
240241
:slant ,s-maybe-italic))))
241242
`(font-lock-function-name-face ((,class (:foreground ,blue))))
@@ -919,7 +920,7 @@
919920
`(highlight-indentation-face ((,class (:background ,base02))))
920921
`(highlight-indentation-current-column-face((,class (:background ,base02))))
921922
;;;;; highlight-numbers
922-
`(highlight-numbers-number ((,class (:foreground ,violet :bold nil))))
923+
`(highlight-numbers-number ((,class (:inherit font-lock-number-face))))
923924
;;;;; highlight-symbol
924925
`(highlight-symbol-face ((,class (:foreground ,magenta))))
925926
;;;;; hl-line-mode

solarized.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ Related discussion: https://github.com/bbatsov/solarized-emacs/issues/158"
5252
:type 'boolean
5353
:group 'solarized)
5454

55+
(defcustom solarized-highlight-numbers nil
56+
"Highlight all numbers.
57+
Applies color to `font-lock-number-face' and `highlight-numbers' mode.
58+
Many tree-sitter based modes use `font-lock-number-face'."
59+
:type 'boolean
60+
:group 'solarized)
61+
5562
(defcustom solarized-use-variable-pitch t
5663
"Use variable pitch face for some headings and titles."
5764
:type 'boolean

0 commit comments

Comments
 (0)