Skip to content

Commit 3a44a19

Browse files
committed
auto merge of #20894 : swgillespie/rust/emacs-issue-20422, r=pnkfelix
rust-mode.el recently started highlighting keywords that were substrings of identifiers. Identifiers such as `xyz_type` would have `type` highlighted, which isn't normal. This patch re-introduces `_` as a word constituent, so that keywords following a `_` don't get syntax highlighted as keywords. Fixes issue #20422
2 parents 055cc2e + f82c75b commit 3a44a19

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/etc/emacs/rust-mode.el

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
(modify-syntax-entry ?\" "\"" table)
3232
(modify-syntax-entry ?\\ "\\" table)
3333

34+
;; mark _ as a word constituent so that identifiers
35+
;; such as xyz_type don't cause type to be highlighted
36+
;; as a keyword
37+
(modify-syntax-entry ?_ "w" table)
38+
3439
;; Comments
3540
(modify-syntax-entry ?/ ". 124b" table)
3641
(modify-syntax-entry ?* ". 23" table)

0 commit comments

Comments
 (0)