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

    Passed indent tests for PSR-2
---
 phps-mode-indent.el | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/phps-mode-indent.el b/phps-mode-indent.el
index 22759692ea..6504cff378 100644
--- a/phps-mode-indent.el
+++ b/phps-mode-indent.el
@@ -553,13 +553,18 @@
               ;; or
               ;; default;
               ;;     echo 'here';
-              (when (or
-                     (string-match-p
-                      "^[\t ]*case[\t ]+.*\\(;\\|:\\)[\t ]*$"
-                      previous-line-string)
-                     (string-match-p
-                      "^[\t ]*default.*\\(;\\|:\\)[\t ]*$"
-                      previous-line-string))
+              (when (and
+                     (not
+                      (string-match-p
+                       "^[\t ]*\\(case[\t ]+\\|default\\)"
+                       current-line-string))
+                     (or
+                      (string-match-p
+                       "^[\t ]*case[\t ]+.*\\(;\\|:\\)[\t ]*$"
+                       previous-line-string)
+                      (string-match-p
+                       "^[\t ]*default.*\\(;\\|:\\)[\t ]*$"
+                       previous-line-string)))
                 (setq
                  previous-bracket-level
                  (+ previous-bracket-level tab-width)))

Reply via email to