Skip to content

Commit

Permalink
auto merge of #20894 : swgillespie/rust/emacs-issue-20422, r=pnkfelix
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jan 12, 2015
2 parents 055cc2e + f82c75b commit 3a44a19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/etc/emacs/rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
(modify-syntax-entry ?\" "\"" table)
(modify-syntax-entry ?\\ "\\" table)

;; mark _ as a word constituent so that identifiers
;; such as xyz_type don't cause type to be highlighted
;; as a keyword
(modify-syntax-entry ?_ "w" table)

;; Comments
(modify-syntax-entry ?/ ". 124b" table)
(modify-syntax-entry ?* ". 23" table)
Expand Down

0 comments on commit 3a44a19

Please sign in to comment.