Add the explicit character at the beginning of the regexp

This commit is contained in:
Gerry Agbobada 2020-04-14 20:09:33 +02:00
parent 810baea2ea
commit 03748d48cd
No known key found for this signature in database
GPG key ID: BE26DBAFD866BE34

View file

@ -99,35 +99,35 @@ Otherwise it builds `prettify-code-symbols-alist' according to
(add-hook 'after-change-major-mode-hook #'+pretty-code-init-pretty-symbols-h) (add-hook 'after-change-major-mode-hook #'+pretty-code-init-pretty-symbols-h)
(defvar +prog-ligatures-alist (defvar +prog-ligatures-alist
'((?! . ".\\(?:\\(==\\|[!=]\\)[!=]?\\)") '((?! . "!\\(?:\\(==\\|[!=]\\)[!=]?\\)")
(?# . ".\\(?:\\(###?\\|_(\\|[(:=?[_{]\\)[#(:=?[_{]?\\)") (?# . "#\\(?:\\(###?\\|_(\\|[(:=?[_{]\\)[#(:=?[_{]?\\)")
(?$ . ".\\(?:\\(>\\)>?\\)") (?$ . "$\\(?:\\(>\\)>?\\)")
(?% . ".\\(?:\\(%\\)%?\\)") (?% . "%\\(?:\\(%\\)%?\\)")
(?& . ".\\(?:\\(&\\)&?\\)") (?& . "&\\(?:\\(&\\)&?\\)")
(?* . ".\\(?:\\(\\*\\*\\|[*>]\\)[*>]?\\)") (?* . "*\\(?:\\(\\*\\*\\|[*>]\\)[*>]?\\)")
;; (?* . ".\\(?:\\(\\*\\*\\|[*/>]\\).?\\)") ;; (?* . "*\\(?:\\(\\*\\*\\|[*/>]\\).?\\)")
(?+ . ".\\(?:\\([>]\\)>?\\)") (?+ . "+\\(?:\\([>]\\)>?\\)")
;; (?+ . ".\\(?:\\(\\+\\+\\|[+>]\\).?\\)") ;; (?+ . "+\\(?:\\(\\+\\+\\|[+>]\\).?\\)")
(?- . ".\\(?:\\(-[->]\\|<<\\|>>\\|[-<>|~]\\)[-<>|~]?\\)") (?- . "-\\(?:\\(-[->]\\|<<\\|>>\\|[-<>|~]\\)[-<>|~]?\\)")
;; (?. . ".\\(?:\\(\\.[.<]\\|[-.=]\\)[-.<=]?\\)") ;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\\)") (?? . "?\\(?:\\([.:=?]\\)[.:=?]?\\)")
(91 . ".\\(?:\\(|\\)[]|]?\\)") ;; 91 is [ (91 . "\\[\\(?:\\(|\\)[]|]?\\)") ;; 91 is [
;; (?\ . ".\\(?:\\([\\n]\\)[\\]?\\)") ;; (?\ . "\\\\\\(?:\\([\\n]\\)[\\]?\\)")
(?^ . ".\\(?:\\(=\\)=?\\)") (?^ . "^\\(?:\\(=\\)=?\\)")
(?_ . ".\\(?:\\(|_\\|[_]\\)_?\\)") (?_ . "_\\(?:\\(|_\\|[_]\\)_?\\)")
(?w . ".\\(?:\\(ww\\)w?\\)") (?w . "w\\(?:\\(ww\\)w?\\)")
(?{ . ".\\(?:\\(|\\)[|}]?\\)") (?{ . "{\\(?:\\(|\\)[|}]?\\)")
(?| . ".\\(?:\\(->\\|=>\\||[-=>]\\||||*>\\|[]=>|}-]\\).?\\)") (?| . "|\\(?:\\(->\\|=>\\||[-=>]\\||||*>\\|[]=>|}-]\\).?\\)")
(?~ . ".\\(?:\\(~>\\|[-=>@~]\\)[-=>@~]?\\)")) (?~ . "~\\(?:\\(~>\\|[-=>@~]\\)[-=>@~]?\\)"))
"An alist containing all the ligatures used when in a `+prog-ligatures-modes' mode. "An alist containing all the ligatures used when in a `+prog-ligatures-modes' mode.
The car is the character ASCII number, cdr is a regex which will call `font-shape-gstring' The car is the character ASCII number, cdr is a regex which will call `font-shape-gstring'