summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-07-28 11:06:08 -0600
committerGitHub <noreply@github.com>2017-07-28 11:06:08 -0600
commit09efc45dee786cb220c233426ddd82b26ad950eb (patch)
tree4f4f6966a972776ac62f7639c550f37e4d256abf /rust-mode.el
parent0985f5fde747f64b3fcff2661226aa4dad286e04 (diff)
parent34cc528f04574068e1d222c8122354fb4a9278ab (diff)
downloadrust-mode-09efc45dee786cb220c233426ddd82b26ad950eb.tar.gz
Merge pull request #219 from Aankhen/highlight-question-mark
Highlight question mark operator using new `rust-question-mark-face'
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/rust-mode.el b/rust-mode.el
index 2c58545..eac246f 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -165,6 +165,11 @@ function or trait. When nil, where will be aligned with fn or trait."
"Face for the `unsafe' keyword."
:group 'rust-mode)
+(defface rust-question-mark-face
+ '((t :weight bold :inherit font-lock-builtin-face))
+ "Face for the question mark operator."
+ :group 'rust-mode)
+
(defun rust-paren-level () (nth 0 (syntax-ppss)))
(defun rust-in-str-or-cmnt () (nth 8 (syntax-ppss)))
(defun rust-rewind-past-str-cmnt () (goto-char (nth 8 (syntax-ppss))))
@@ -603,6 +608,9 @@ the desired identifiers), but does not match type annotations \"foo::<\"."
;; CamelCase Means Type Or Constructor
(,rust-re-type-or-constructor 1 font-lock-type-face)
+
+ ;; Question mark operator
+ ("\\?" . 'rust-question-mark-face)
)
;; Item definitions