diff options
| author | Christophe Troestler <Christophe.Troestler@umons.ac.be> | 2021-12-24 15:50:00 +0100 |
|---|---|---|
| committer | Christophe Troestler <Christophe.Troestler@umons.ac.be> | 2021-12-25 15:22:38 +0100 |
| commit | b83b34e82d366e52324f675de9829ae96fd065b1 (patch) | |
| tree | 0fd5e2ad3d1b00e0900a5b5b8b10b940086c797a | |
| parent | b017f746503df27ccdca8ee6d2627529d64d76e1 (diff) | |
| download | rust-mode-b83b34e82d366e52324f675de9829ae96fd065b1.tar.gz | |
Add a face for the ampersand reference mark
Customizing this face may improve code readability for some users.
By default nothing is set for backward compatibility.
| -rw-r--r-- | rust-mode-tests.el | 1 | ||||
| -rw-r--r-- | rust-mode.el | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 9c23ed4..24c2682 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1699,6 +1699,7 @@ this_is_not_a_string();)" "foo" font-lock-type-face "x" font-lock-variable-name-face ;; This union is the name of a lifetime. + "&" rust-ampersand-face "union" font-lock-variable-name-face "bar" font-lock-type-face))) diff --git a/rust-mode.el b/rust-mode.el index fca9e9f..57feaaa 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -101,6 +101,11 @@ to the function arguments. When nil, `->' will be indented one level." "Face for the question mark operator." :group 'rust-mode) +(defface rust-ampersand-face + '((t :inherit default)) + "Face for the ampersand reference mark." + :group 'rust-mode) + (defface rust-builtin-formatting-macro '((t :inherit font-lock-builtin-face)) "Face for builtin formatting macros (print! &c.)." @@ -437,6 +442,7 @@ Does not match type annotations of the form \"foo::<\"." ;; Question mark operator ("\\?" . 'rust-question-mark) + ("\\(&\\)'?\\<" 1 'rust-ampersand-face) ) ;; Ensure we highlight `Foo` in `struct Foo` as a type. |
