Skip to content

Commit 0e99c40

Browse files
authored
Merge pull request #316 from ejmr/issue-314
Don't move cursor position in php-mode
2 parents f148849 + 5f30e1e commit 0e99c40

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

php-mode-test.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,13 @@ style from Drupal."
612612
(php-mode)
613613
(should-not (buffer-modified-p))))
614614

615+
(ert-deftest php-mode-test-issue-314 ()
616+
"Activating php-mode should not move point."
617+
(with-php-mode-test ("issue-314.php")
618+
(let ((orig-point (point)))
619+
(php-mode)
620+
(should (eq (point) orig-point)))))
621+
615622
(ert-deftest php-mode-test-issue-310 ()
616623
"Proper indentation after function with return type."
617624
(with-php-mode-test ("issue-310.php" :indent t :magic t)))

php-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,8 @@ PHP heredoc."
10791079

10801080
(when (>= emacs-major-version 25)
10811081
(with-silent-modifications
1082-
(php-syntax-propertize-function (point-min) (point-max)))))
1082+
(save-excursion
1083+
(php-syntax-propertize-function (point-min) (point-max))))))
10831084

10841085

10851086
;; Define function name completion function

tests/issue-314.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
// It's the apostrophe.

0 commit comments

Comments
 (0)