Skip to content

Fix font-locking of "let ref" #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rust-mode-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,11 @@ list of substrings of `STR' each followed by its face."
"let foo;"
'("let" font-lock-keyword-face
"foo" font-lock-variable-name-face))
(rust-test-font-lock
"let ref foo;"
'("let" font-lock-keyword-face
"ref" font-lock-keyword-face
"foo" font-lock-variable-name-face))
(rust-test-font-lock
"let mut foo;"
'("let" font-lock-keyword-face
Expand Down
2 changes: 1 addition & 1 deletion rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ match data if found. Returns nil if not within a Rust string."
(,rust-re-type-or-constructor 1 font-lock-type-face)

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

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