]> git.lizzy.rs Git - rust.git/commitdiff
emacs: highlight `#[foo = "bar"]` attributes
authorTom Jakubowski <tom@crystae.net>
Wed, 11 Jun 2014 12:06:51 +0000 (05:06 -0700)
committerTom Jakubowski <tom@crystae.net>
Wed, 11 Jun 2014 12:06:51 +0000 (05:06 -0700)
Setting `OVERRIDE` to `t` overrides the conflicting highlight Emacs
places on string literals.

Fix #14347

src/etc/emacs/rust-mode.el

index f5a3fb92cb953f08d27415c35edfdd1c2dcc1bc9..bec78302f05b6c4676ed011eab3fcca4ada27eeb 100644 (file)
      ;; Special types
      (,(regexp-opt rust-special-types 'words) . font-lock-type-face)
 
-     ;; Attributes like `#[bar(baz)]` or `#![bar(baz)]`
+     ;; Attributes like `#[bar(baz)]` or `#![bar(baz)]` or `#[bar = "baz"]`
      (,(rust-re-grab (concat "#\\!?\\[" rust-re-ident "[^]]*\\]"))
-      1 font-lock-preprocessor-face)
+      1 font-lock-preprocessor-face t)
 
      ;; Syntax extension invocations like `foo!`, highlight including the !
      (,(concat (rust-re-grab (concat rust-re-ident "!")) "[({[:space:][]")