branch: externals/phps-mode
commit 1ed09d42f52ac80dce076b94114364b624459bc8
Author: Christian Johansson <christ...@cvj.se>
Commit: Christian Johansson <christ...@cvj.se>

    Passing another indent test
---
 phps-mode-indent.el           | 20 ++++++++++++++++++--
 test/phps-mode-test-indent.el |  2 +-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index 16e1ca4d74..85c6427bc8 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -519,8 +519,9 @@
                               (setq
                                previous-concatenation2
                                (point))))
-                        keep-searching
-                        nil)))
+                        (setq
+                         keep-searching
+                         nil))))
 
                   (if previous-concatenation
                       (let ((first-concatenated-line-indent
@@ -727,6 +728,21 @@
 
                 (goto-char point))
 
+              ;; echo <<<VAR
+              ;; abc
+              ;; or
+              ;; echo <<<'VAR'
+              ;; abc
+              ;; or
+              ;; echo <<<"VAR"
+              ;; abc
+              (when
+                  (string-match-p
+                   "<<<'?\"?[a-zA-Z0-9]+'?\"?$"
+                   previous-line-string)
+                (setq new-indentation 0))
+
+
               ;; Decrease indentation if current line decreases in bracket 
level
               (when (< new-indentation 0)
                 (setq new-indentation 0))
diff --git a/test/phps-mode-test-indent.el b/test/phps-mode-test-indent.el
index bd8d4c6b72..211c2cbb3a 100644
--- a/test/phps-mode-test-indent.el
+++ b/test/phps-mode-test-indent.el
@@ -78,7 +78,7 @@
    "HEREDOC in arguments example")
 
   (phps-mode-test-indent--should-equal
-   "<?php\n$str = <<<'EOD'\nExample of string\nspanning multiple lines\nusing 
nowdoc syntax.\nEOD;\n"
+   "<?php\n$str = <<<'EOD'\nExample of string\nspanning multiple lines\nusing 
nowdoc syntax\nEOD;\n"
    "Multi-line NOWDOC string")
 
   (phps-mode-test-indent--should-equal

Reply via email to