From 2de213e94f5281808c7c6f8faeb641d4725e4207 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 2 Apr 2015 05:41:20 +0300 Subject: [PATCH] company-dabbrev--search-buffer: Save match data --- company-dabbrev.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/company-dabbrev.el b/company-dabbrev.el index 7dd874be4..2ab4303e3 100644 --- a/company-dabbrev.el +++ b/company-dabbrev.el @@ -111,14 +111,14 @@ This variable affects both `company-dabbrev' and `company-dabbrev-code'." ;; search before pos (company-dabrev--time-limit-while (re-search-backward regexp nil t) start limit - (if (and ignore-comments (company-in-string-or-comment)) + (if (and ignore-comments (save-match-data (company-in-string-or-comment))) (goto-char (nth 8 (syntax-ppss))) (maybe-collect-match))) (goto-char (or pos (point-min))) ;; search after pos (company-dabrev--time-limit-while (re-search-forward regexp nil t) start limit - (if (and ignore-comments (company-in-string-or-comment)) + (if (and ignore-comments (save-match-data (company-in-string-or-comment))) (re-search-forward "\\s>\\|\\s!\\|\\s\"" nil t) (maybe-collect-match))) symbols))) -- 2.39.2