branch: externals/phps-mode commit 9d6af116c2b11c1219e07b588be57b8a3eafb708 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
More work on indentations --- phps-mode-lexer.el | 2 ++ phps-mode-test-functions.el | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el index e1ea834..50a22f9 100644 --- a/phps-mode-lexer.el +++ b/phps-mode-lexer.el @@ -541,6 +541,8 @@ ((looking-at "\\?>\n?") (let ((start (match-beginning 0)) (end (match-end 0))) + (when (= (- end start) 3) + (setq end (1- end))) (phps-mode-lexer-BEGIN phps-mode-lexer-ST_INITIAL) (when phps-mode-lexer-PARSER_MODE (phps-mode-lexer-RETURN_TOKEN ";" start end)) diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el index 3a2330a..53c5a7a 100644 --- a/phps-mode-test-functions.el +++ b/phps-mode-test-functions.el @@ -122,10 +122,11 @@ (phps-mode-test-with-buffer "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) {\necho $title3;\n\n}\n?>\n</title><body>Bla bla</body></html>" "Curly bracket test 4" + ;; (message "Tokens: %s" phps-mode-lexer-tokens) (goto-char 110) (phps-mode-functions-indent-line) (let ((buffer-contents (buffer-substring-no-properties (point-min) (point-max)))) - (should (equal buffer-contents "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) {\necho $title3;\n\n}\n?>\n</title><body>Bla bla</body></html>")))) + (should (equal buffer-contents "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) {\necho $title3;\n\n}\n?>\n</title><body>Bla bla</body></html>")))) (phps-mode-test-with-buffer "<?php\n$variable = array(\n'random3'\n);\n$variable = true;\n"