summaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/yasnippet.el
diff options
context:
space:
mode:
authorSimeon Simeonov2020-05-11 08:57:19 +0200
committerSimeon Simeonov2020-05-11 08:57:19 +0200
commitb4ae205398b94266d012c5cffc64bc1450c3d541 (patch)
tree44887c3a0f79cb146042d0f3b34a2dddf22878ca /.emacs.d/lisp/yasnippet.el
parentff5a069cf024565751e4db4783c18e920994b211 (diff)
parentaa6722130316cd9460a5276bd07486887411799a (diff)
Merge branch 'master' of pichove.org:emacs-config
Diffstat (limited to '.emacs.d/lisp/yasnippet.el')
-rw-r--r--.emacs.d/lisp/yasnippet.el14
1 files changed, 12 insertions, 2 deletions
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."
386;; Only two faces, and one of them shouldn't even be used... 386;; Only two faces, and one of them shouldn't even be used...
387;; 387;;
388(defface yas-field-highlight-face 388(defface yas-field-highlight-face
389 '((t (:inherit 'region))) 389 '((t (:inherit region)))
390 "The face used to highlight the currently active field of a snippet") 390 "The face used to highlight the currently active field of a snippet")
391 391
392(defface yas--field-debug-face 392(defface yas--field-debug-face
@@ -1399,6 +1399,9 @@ conditions to filter out potential expansions."
1399 (push (cons name template) acc)) 1399 (push (cons name template) acc))
1400 namehash)) 1400 namehash))
1401 (yas--table-hash table)) 1401 (yas--table-hash table))
1402 (maphash #'(lambda (uuid template)
1403 (push (cons uuid template) acc))
1404 (yas--table-uuidhash table))
1402 (yas--filter-templates-by-condition acc)))) 1405 (yas--filter-templates-by-condition acc))))
1403 1406
1404(defun yas--templates-for-key-at-point () 1407(defun yas--templates-for-key-at-point ()
@@ -4727,7 +4730,14 @@ When multiple expressions are found, only the last one counts."
4727 ;; 4730 ;;
4728 (save-excursion 4731 (save-excursion
4729 (while (re-search-forward yas--field-regexp nil t) 4732 (while (re-search-forward yas--field-regexp nil t)
4730 (let* ((real-match-end-0 (yas--scan-sexps (1+ (match-beginning 0)) 1)) 4733 (let* ((brace-scan (yas--scan-sexps (1+ (match-beginning 0)) 1))
4734 ;; if the `brace-scan' didn't reach a brace, we have a
4735 ;; snippet with invalid escaping, probably a closing
4736 ;; brace escaped with two backslashes (github#979). But
4737 ;; be lenient, because we can.
4738 (real-match-end-0 (if (eq ?} (char-before brace-scan))
4739 brace-scan
4740 (point)))
4731 (number (and (match-string-no-properties 1) 4741 (number (and (match-string-no-properties 1)
4732 (string-to-number (match-string-no-properties 1)))) 4742 (string-to-number (match-string-no-properties 1))))
4733 (brand-new-field (and real-match-end-0 4743 (brand-new-field (and real-match-end-0