summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-02-15 05:10:43 -0500
committerGitHub <noreply@github.com>2018-02-15 05:10:43 -0500
commit0d408d5fe5bae38f6463e78486eab4263d4ae40d (patch)
tree9c925fe79dcde0308de39f153c78ed34b2b9bd7f /rust-mode.el
parentb911835c8e431ec1523e71b73ffd82cd6b80157c (diff)
parent705f3e40a818d6b293c2460a7e6e2985c400a654 (diff)
downloadrust-mode-0d408d5fe5bae38f6463e78486eab4263d4ae40d.tar.gz
Merge pull request #253 from jjwest/master
Improved font-locking for print macros
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust-mode.el b/rust-mode.el
index a5987ed..0c31b6c 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -633,7 +633,7 @@ match data if found. Returns nil if not within a Rust string."
"List of builtin Rust macros for string formatting used by `rust-mode-font-lock-keywords'. (`write!' is handled separately.)")
(defvar rust-formatting-macro-opening-re
- "[[:space:]]*[({[][[:space:]]*"
+ "[[:space:]\n]*[({[][[:space:]\n]*"
"Regular expression to match the opening delimiter of a Rust formatting macro.")
(defvar rust-start-of-string-re
@@ -661,7 +661,7 @@ match data if found. Returns nil if not within a Rust string."
1 font-lock-preprocessor-face keep)
;; Builtin formatting macros
- (,(concat (rust-re-grab (concat (regexp-opt rust-builtin-formatting-macros) "!")) (concat rust-formatting-macro-opening-re rust-start-of-string-re))
+ (,(concat (rust-re-grab (concat (regexp-opt rust-builtin-formatting-macros) "!")) (concat rust-formatting-macro-opening-re "\\(?:" rust-start-of-string-re) "\\)?")
(1 'rust-builtin-formatting-macro-face)
(rust-string-interpolation-matcher
(rust-end-of-string)