Skip to content

Commit d435866

Browse files
committed
Add save-match-data macro to php-get-current-element
1 parent 2a5f7f7 commit d435866

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

php.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@ can be used to match against definitions for that classlike."
244244
(defun php-get-current-element (re-pattern)
245245
"Return backward matched element by RE-PATTERN."
246246
(save-excursion
247-
(when (re-search-backward re-pattern nil t)
248-
(match-string-no-properties 1))))
247+
(save-match-data
248+
(when (re-search-backward re-pattern nil t)
249+
(match-string-no-properties 1)))))
249250

250251
;;; Provide support for Flymake so that users can see warnings and
251252
;;; errors in real-time as they write code.

0 commit comments

Comments
 (0)