Skip to content

Commit f80a0ce

Browse files
committed
Do not prettify && when it is a double reference
1 parent eba5441 commit f80a0ce

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

rust-mode.el

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,14 @@ Use idomenu (imenu with `ido-mode') for best mileage.")
222222
See `prettify-symbols-compose-predicate'."
223223
(and (fboundp 'prettify-symbols-default-compose-p)
224224
(prettify-symbols-default-compose-p start end match)
225-
;; Make sure there is a space before || as it is also used for
226-
;; functions with 0 arguments.
227-
(not (and (string= match "||")
228-
(save-excursion
229-
(goto-char start)
230-
(looking-back "\\(?:\\<move\\|=\\) *"))))))
225+
;; Make sure || is not a closure with 0 arguments and && is not
226+
;; a double reference.
227+
(pcase match
228+
("||" (not (save-excursion
229+
(goto-char start)
230+
(looking-back "\\(?:\\<move\\|=\\) *"))))
231+
("&&" (char-equal (char-after end) ?\s))
232+
(_ t))))
231233

232234
;;; Mode
233235

0 commit comments

Comments
 (0)