Skip to content

Commit 64b4a24

Browse files
authored
Merge pull request #272 from tromey/let-ref-font-lock
Fix font-locking of "let ref"
2 parents 07e16c6 + e201404 commit 64b4a24

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rust-mode-tests.el

+5
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,11 @@ list of substrings of `STR' each followed by its face."
12961296
"let foo;"
12971297
'("let" font-lock-keyword-face
12981298
"foo" font-lock-variable-name-face))
1299+
(rust-test-font-lock
1300+
"let ref foo;"
1301+
'("let" font-lock-keyword-face
1302+
"ref" font-lock-keyword-face
1303+
"foo" font-lock-variable-name-face))
12991304
(rust-test-font-lock
13001305
"let mut foo;"
13011306
'("let" font-lock-keyword-face

rust-mode.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ match data if found. Returns nil if not within a Rust string."
687687
(,rust-re-type-or-constructor 1 font-lock-type-face)
688688

689689
;; Type-inferred binding
690-
(,(concat "\\_<\\(?:let\\|ref\\)\\s-+\\(?:mut\\s-+\\)?" (rust-re-grab rust-re-ident) "\\_>") 1 font-lock-variable-name-face)
690+
(,(concat "\\_<\\(?:let\\s-+ref\\|let\\|ref\\)\\s-+\\(?:mut\\s-+\\)?" (rust-re-grab rust-re-ident) "\\_>") 1 font-lock-variable-name-face)
691691

692692
;; Type names like `Foo::`, highlight excluding the ::
693693
(,(rust-path-font-lock-matcher rust-re-uc-ident) 1 font-lock-type-face)

0 commit comments

Comments
 (0)