Skip to content

Commit a551255

Browse files
committed
Fix chained method indentation for PSR2
1 parent 4f63bb8 commit a551255

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

php-mode.el

+9-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,15 @@ might be to handle switch and goto labels differently."
590590
"Line up chained methods using `c-lineup-cascaded-calls',
591591
but only if the setting is enabled"
592592
(if php-lineup-cascaded-calls
593-
(c-lineup-cascaded-calls langelem)))
593+
(c-lineup-cascaded-calls langelem)
594+
(when (string= c-indentation-style "psr2")
595+
(save-excursion
596+
(back-to-indentation)
597+
(unless (php-in-string-or-comment-p)
598+
(when (looking-at-p "-\\s-*>")
599+
(goto-char (cdr langelem))
600+
(let ((col (current-indentation)))
601+
(vector (+ col c-basic-offset)))))))))
594602

595603
(c-add-style
596604
"php"

0 commit comments

Comments
 (0)