[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 0d408d5 357/486: Merge pull request #253 from jj
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 0d408d5 357/486: Merge pull request #253 from jjwest/master |
Date: |
Sat, 7 Aug 2021 09:25:52 -0400 (EDT) |
branch: elpa/rust-mode
commit 0d408d5fe5bae38f6463e78486eab4263d4ae40d
Merge: b911835 705f3e4
Author: Niko Matsakis <niko@alum.mit.edu>
Commit: GitHub <noreply@github.com>
Merge pull request #253 from jjwest/master
Improved font-locking for print macros
---
rust-mode-tests.el | 13 +++++++++++++
rust-mode.el | 4 ++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 6c6e9af..fd29d5d 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -2193,6 +2193,19 @@ fn main() {
"\"\"" font-lock-string-face
"/* " font-lock-comment-delimiter-face
"print!(\"\"); */" font-lock-comment-face))
+ ;; with newline directly following delimiter
+ (rust-test-font-lock
+ "print!(\n\"\"\n); { /* print!(\"\"); */ }"
+ '("print!" rust-builtin-formatting-macro-face
+ "\"\"" font-lock-string-face
+ "/* " font-lock-comment-delimiter-face
+ "print!(\"\"); */" font-lock-comment-face))
+ ;; with empty println!()
+ (rust-test-font-lock
+ "println!(); { /* println!(); */ }"
+ '("println!" rust-builtin-formatting-macro-face
+ "/* " font-lock-comment-delimiter-face
+ "println!(); */" font-lock-comment-face))
;; other delimiters
(rust-test-font-lock
"print!{\"\"}; { /* no-op */ }"
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)
- [nongnu] elpa/rust-mode 2a9fcd0 321/486: Add syntax highlighting and imenu support for `union`, (continued)
- [nongnu] elpa/rust-mode 2a9fcd0 321/486: Add syntax highlighting and imenu support for `union`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 89320ad 323/486: Highlight interpolation in arguments to print! &c., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e48a650 329/486: Merge pull request #225 from Aankhen/add-var-colours, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6e9db46 331/486: Merge pull request #230 from tromey/fix-indentation-bug, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0e832ec 340/486: Remove `float`, `int`, and `uint` as built-in types., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 302b537 344/486: Revert #216 and Add Suggestions from #226, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b8e4908 345/486: Merge pull request #243 from iwillspeak/rust-compile-command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6bcb82b 350/486: Merge pull request #249 from brotzeit/rust--format-call, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 705f3e4 352/486: Improved font-locking for print macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2fe1f9d 355/486: add dyn to keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0d408d5 357/486: Merge pull request #253 from jjwest/master,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 42c98bb 362/486: Merge pull request #263 from nikomatsakis/tweak-compilation-regexp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 3613551 365/486: throw error in after-save-hook instead of before-save-hook, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 64b4a24 368/486: Merge pull request #272 from tromey/let-ref-font-lock, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 106aeab 369/486: Merge pull request #267 from jthemphill/patch-1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 256db76 371/486: Merge pull request #281 from ksqsf/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5d0406f 374/486: adjust docstring formatting, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b445737 376/486: imenu: handle lifetimes in impl blocks., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 72f795d 378/486: Add rust-run and rust-test interactive function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e2e713e 384/486: refer to (point-min) instead of 1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 497d476 388/486: Reverted back to font-lock-fontify-buffer, ELPA Syncer, 2021/08/07