branch: externals/phps-mode commit c11bcc5e948ab8712d73f68853e49852e530453d Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
More work on newline advice --- phps-mode-functions.el | 2 +- phps-mode-test-functions.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phps-mode-functions.el b/phps-mode-functions.el index 5584a67..e91e69a 100644 --- a/phps-mode-functions.el +++ b/phps-mode-functions.el @@ -804,11 +804,11 @@ (defun phps-mode-functions-around-newline (old-function &rest arguments) "Call OLD-FUNCTION with ARGUMENTS and then shift indexes if the rest of the line is just whitespace." + (message "Running advice") (let ((old-pos (point)) (new-pos) (looking-at-whitespace (looking-at-p "[\ \n\t\r]*\n"))) (apply old-function arguments) - (message "Running advice") (if looking-at-whitespace (progn (setq new-pos (point)) diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el index 4052d76..517614b 100644 --- a/phps-mode-test-functions.el +++ b/phps-mode-test-functions.el @@ -863,7 +863,7 @@ (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)))) (goto-char 21) - (newline-and-indent) + (newline) (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))))))