From aa6722130316cd9460a5276bd07486887411799a Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Fri, 20 Dec 2019 12:02:17 +0100 Subject: Upgrade all modes --- .emacs.d/lisp/yasnippet.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to '.emacs.d/lisp/yasnippet.el') diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el index 3bbb94d..bfd904e 100644 --- a/.emacs.d/lisp/yasnippet.el +++ b/.emacs.d/lisp/yasnippet.el @@ -386,7 +386,7 @@ It must be set to nil before loading yasnippet to take effect." ;; Only two faces, and one of them shouldn't even be used... ;; (defface yas-field-highlight-face - '((t (:inherit 'region))) + '((t (:inherit region))) "The face used to highlight the currently active field of a snippet") (defface yas--field-debug-face @@ -1399,6 +1399,9 @@ conditions to filter out potential expansions." (push (cons name template) acc)) namehash)) (yas--table-hash table)) + (maphash #'(lambda (uuid template) + (push (cons uuid template) acc)) + (yas--table-uuidhash table)) (yas--filter-templates-by-condition acc)))) (defun yas--templates-for-key-at-point () @@ -4727,7 +4730,14 @@ When multiple expressions are found, only the last one counts." ;; (save-excursion (while (re-search-forward yas--field-regexp nil t) - (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1)) + (let* ((brace-scan (yas--scan-sexps (1+ (match-beginning 0)) 1)) + ;; if the `brace-scan' didn't reach a brace, we have a + ;; snippet with invalid escaping, probably a closing + ;; brace escaped with two backslashes (github#979). But + ;; be lenient, because we can. + (real-match-end-0 (if (eq ?} (char-before brace-scan)) + brace-scan + (point))) (number (and (match-string-no-properties 1) (string-to-number (match-string-no-properties 1)))) (brand-new-field (and real-match-end-0 -- cgit v1.3