From f80a0ce35b5b4d179b043d01ec7a55dcaf04f8ab Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Mon, 27 Dec 2021 11:40:28 +0100 Subject: Do not prettify && when it is a double reference --- rust-mode.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'rust-mode.el') diff --git a/rust-mode.el b/rust-mode.el index eec6057..6f8a214 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -222,12 +222,14 @@ Use idomenu (imenu with `ido-mode') for best mileage.") See `prettify-symbols-compose-predicate'." (and (fboundp 'prettify-symbols-default-compose-p) (prettify-symbols-default-compose-p start end match) - ;; Make sure there is a space before || as it is also used for - ;; functions with 0 arguments. - (not (and (string= match "||") - (save-excursion - (goto-char start) - (looking-back "\\(?:\\ Date: Mon, 27 Dec 2021 19:56:51 +0100 Subject: Do not prettify || after various symbols --- rust-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust-mode.el') diff --git a/rust-mode.el b/rust-mode.el index 6f8a214..32794c5 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -227,7 +227,7 @@ See `prettify-symbols-compose-predicate'." (pcase match ("||" (not (save-excursion (goto-char start) - (looking-back "\\(?:\\ Date: Mon, 27 Dec 2021 12:11:49 +0100 Subject: Improve regexp to match the reference mark & --- rust-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rust-mode.el') diff --git a/rust-mode.el b/rust-mode.el index 32794c5..773251d 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -467,7 +467,8 @@ Does not match type annotations of the form \"foo::<\"." ;; Question mark operator ("\\?" . 'rust-question-mark) - ("\\(&\\)'?\\<" 1 'rust-ampersand-face) + ("\\(&+\\)\\(?:'\\(?:\\<\\|_\\)\\|\\<\\|[[({:*_|]\\)" + 1 'rust-ampersand-face) ) ;; Ensure we highlight `Foo` in `struct Foo` as a type. -- cgit v1.2.3