branch: externals/phps-mode commit 22f75baf02e8e6e68529f4b25faa204100571e38 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Advice is running again in unit test --- phps-mode-functions.el | 3 ++- phps-mode-test-functions.el | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phps-mode-functions.el b/phps-mode-functions.el index 0ca4031..c63e97d 100644 --- a/phps-mode-functions.el +++ b/phps-mode-functions.el @@ -811,6 +811,7 @@ (apply old-function arguments) (if looking-at-whitespace (progn + (message "Looking at white-space") (setq new-pos (point)) (let ((diff (- new-pos old-pos))) (when (> diff 0) @@ -983,7 +984,7 @@ (set (make-local-variable 'indent-tabs-mode) nil)) ;; Add support for moving indexes quickly when making newlines - (advice-add 'newline :around #'phps-mode-functions-around-newline) + (advice-add #'newline :around #'phps-mode-functions-around-newline) ;; Reset flags (set (make-local-variable 'phps-mode-functions-buffer-changes-start) nil) diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el index 4052d76..bcce4f9 100644 --- a/phps-mode-test-functions.el +++ b/phps-mode-test-functions.el @@ -861,11 +861,11 @@ "Add newline between two assignments and inspect moved tokens and states" (message "Tokens %s" (phps-mode-lexer-get-tokens)) (should (equal (phps-mode-lexer-get-tokens) - '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) (T_CONSTANT_ENCAPSED_STRING 14 . 19) (";" 19 . 20) (T_VARIABLE 22 . 27) ("=" 28 . 29) (T_CONSTANT_ENCAPSED_STRING 30 . 35) (";" 35. 36)))) + '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) (T_CONSTANT_ENCAPSED_STRING 14 . 19) (";" 19 . 20) (T_VARIABLE 22 . 27) ("=" 28 . 29) (T_CONSTANT_ENCAPSED_STRING 30 . 35) (";" 35 . 36)))) (goto-char 21) - (newline-and-indent) + (newline nil t) (should (equal (phps-mode-lexer-get-tokens) - '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) (T_CONSTANT_ENCAPSED_STRING 14 . 19) (";" 19 . 20) (T_VARIABLE 23 . 28) ("=" 29 . 30) (T_CONSTANT_ENCAPSED_STRING 31 . 36) (";" 36. 37)))))) + '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) (T_CONSTANT_ENCAPSED_STRING 14 . 19) (";" 19 . 20) (T_VARIABLE 23 . 28) ("=" 29 . 30) (T_CONSTANT_ENCAPSED_STRING 31 . 36) (";" 36 . 37)))))) (defun phps-mode-test-functions () "Run test for functions."