branch: master
commit 72c6c4cd7b0e58631e0963ea5345890e1b0aa04b
Author: Noam Postavsky <[email protected]>
Commit: Noam Postavsky <[email protected]>
Fix #618; save match data in yas--scan-sexps
* yasnippet.el (yas--scan-sexps): Save match data.
---
yasnippet.el | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 706c86a..50973e9 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -4015,8 +4015,9 @@ with their evaluated value into
`yas--backquote-markers-and-strings'."
(defun yas--scan-sexps (from count)
(ignore-errors
- (with-syntax-table (standard-syntax-table)
- (scan-sexps from count))))
+ (save-match-data ; `scan-sexps' may modify match data.
+ (with-syntax-table (standard-syntax-table)
+ (scan-sexps from count)))))
(defun yas--make-marker (pos)
"Create a marker at POS with nil `marker-insertion-type'."