branch: externals/phps-mode
commit f2fe7514954de0dc3ae5dff19bc6742521d60bba
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
More work on trying to get PSR-2 indentation working
---
phps-mode-functions.el | 8 +++-----
phps-mode-test-functions.el | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 54fd7e7..54f1fa4 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -466,11 +466,9 @@
(and (string= token ",")
(= round-bracket-level (car
in-assignment-round-bracket-level)))
(and (string= token"]")
- (<= square-bracket-level (car
in-assignment-square-bracket-level))))
+ (< square-bracket-level (car
in-assignment-square-bracket-level))))
(when phps-mode-functions-verbose
(message "Ended assignment"))
- (when first-token-on-line
- )
(pop in-assignment-square-bracket-level)
(pop in-assignment-round-bracket-level)
(unless in-assignment-round-bracket-level
@@ -485,8 +483,6 @@
(push square-bracket-level
in-assignment-square-bracket-level)
(setq in-assignment-level (1+ in-assignment-level))))
- ;; TODO Fix issue with indentation for assignments with
chained object operators
-
;; Keep track of object operators
(when (and (equal token 'T_OBJECT_OPERATOR)
first-token-on-line))
@@ -529,6 +525,8 @@
(when (and nesting-stack
(<= nesting-end (car (car nesting-stack))))
+ ;; TODO Handle case were nesting has decreased less than
next as well
+
(when phps-mode-functions-verbose
(message "\nPopping %s from nesting-stack since %s is
lesser or equal to %s, next value is: %s\n" (car nesting-stack) nesting-end
(car (car nesting-stack)) (nth 1 nesting-stack))
)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 10d6b5a..02f674d 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -774,7 +774,7 @@
(defun phps-mode-test-functions ()
"Run test for functions."
;; (setq debug-on-error t)
- ;; (setq phps-mode-functions-verbose t)
+ (setq phps-mode-functions-verbose t)
(phps-mode-test-functions-get-lines-lindent-if)
(phps-mode-test-functions-get-lines-indent-classes)
(phps-mode-test-functions-get-lines-indent-inline-if)