[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 1ff1d75 193/486: Merge pull request #90 from Wil
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 1ff1d75 193/486: Merge pull request #90 from Wilfred/fix_type_word_boundaries |
Date: |
Sat, 7 Aug 2021 09:25:17 -0400 (EDT) |
branch: elpa/rust-mode
commit 1ff1d7576b6882fc146b38a43ab84f6562441876
Merge: 5f5a428 5e77aed
Author: Micah Chalmer <micah@micahchalmer.net>
Commit: Micah Chalmer <micah@micahchalmer.net>
Merge pull request #90 from Wilfred/fix_type_word_boundaries
Correcting highlighting of capitals in function names.
---
rust-mode-tests.el | 6 ++++++
rust-mode.el | 9 ++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 8f25f06..e621f82 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -979,6 +979,12 @@ list of substrings of `STR' each followed by its face."
'("'\"'" font-lock-string-face
"let" font-lock-keyword-face)))
+(ert-deftest font-lock-fn-contains-capital ()
+ (rust-test-font-lock
+ "fn foo_Bar() {}"
+ '("fn" font-lock-keyword-face
+ "foo_Bar" font-lock-function-name-face)))
+
(ert-deftest font-lock-single-quote-character-literal ()
(rust-test-font-lock
"fn main() { let ch = '\\''; }"
diff --git a/rust-mode.el b/rust-mode.el
index 15c1be7..b237896 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -359,11 +359,14 @@
"bool"
"str" "char"))
-(defconst rust-re-CamelCase "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*")
+(defconst rust-re-type-or-constructor
+ (rx symbol-start
+ (group upper (0+ (any word nonascii digit "_")))
+ symbol-end))
+
(defconst rust-re-pre-expression-operators "[-=!%&*/:<>[{(|.^;}]")
(defun rust-re-word (inner) (concat "\\<" inner "\\>"))
(defun rust-re-grab (inner) (concat "\\(" inner "\\)"))
-(defun rust-re-grabword (inner) (rust-re-grab (rust-re-word inner)))
(defun rust-re-item-def (itype)
(concat (rust-re-word itype) "[[:space:]]+" (rust-re-grab rust-re-ident)))
@@ -400,7 +403,7 @@
(,(concat "'" (rust-re-grab rust-re-ident) "[^']") 1
font-lock-variable-name-face)
;; CamelCase Means Type Or Constructor
- (,(rust-re-grabword rust-re-CamelCase) 1 font-lock-type-face)
+ (,rust-re-type-or-constructor 1 font-lock-type-face)
)
;; Item definitions
- [nongnu] elpa/rust-mode 3798c7e 167/486: fix quoting in two doc strings, (continued)
- [nongnu] elpa/rust-mode 3798c7e 167/486: fix quoting in two doc strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 78e8b08 163/486: Merge pull request #62 from MicahChalmer/a-couple-of-readme-fixes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6e72f64 176/486: Fix bugs in raw strings and character literals, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5937589 169/486: set :safe on two defcustoms, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 102ad5f 181/486: Merge pull request #67 from tromey/fix-two-docstrings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 88ff62a 182/486: Remove unnecessary code with call to undefined function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c49bb12 184/486: Cache (regexp-opt rust-special-types 'symbols) in rust-is-lt-char-operator, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ec3855f 188/486: Recognize runaway raw strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 99c5571 190/486: Merge pull request #68 from tromey/fix-issue-53, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5f5a428 192/486: Merge pull request #88 from kw-udon/nested-comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 1ff1d75 193/486: Merge pull request #90 from Wilfred/fix_type_word_boundaries,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 30d1dac 198/486: Recognize compiler help and notes as "info" messages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 61a35f6 202/486: Merge pull request #97 from syohex/update-url, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0cf2bc3 255/486: Merge pull request #157 from fmdkdd/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c2a0c13 269/486: Add info to enable rustfmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode cd09a54 280/486: Merge pull request #189 from froydnj/minor-cleanups, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 19e6f60 291/486: Merge pull request #199 from tromey/open-paren-in-column-0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7f7b2ac 293/486: mention keybinding for rustfmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 758ab8c 303/486: Add support for "default" keyword, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a73e9ee 004/486: Update reserved words for syntax highlighters (vim is still behind, though), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7724813 306/486: Merge pull request #206 from cjhowe7/master, ELPA Syncer, 2021/08/07