File tree 3 files changed +65
-1
lines changed
3 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -607,7 +607,30 @@ but only if the setting is enabled."
607
607
(c-lineup-cascaded-calls langelem)
608
608
(save-excursion
609
609
(beginning-of-line )
610
- (if (looking-at-p " \\ s-*->" ) '+ nil ))))
610
+ (let ((beginning-of-langelem (cdr langelem))
611
+ (beginning-of-current-line (point ))
612
+ start)
613
+ (skip-chars-forward " " )
614
+ (cond
615
+ ((looking-at-p " ->" ) '+ )
616
+ ((looking-at-p " [:?]" ) '+ )
617
+ ((looking-at-p " [,;]" ) nil )
618
+ ; ; Is the previous line terminated with `,' ?
619
+ ((progn
620
+ (forward-line -1 )
621
+ (end-of-line )
622
+ (skip-chars-backward " " )
623
+ (backward-char 1 )
624
+ (while (and (< beginning-of-langelem (point ))
625
+ (setq start (php-in-string-or-comment-p)))
626
+ (goto-char start)
627
+ (skip-chars-backward " " )
628
+ (backward-char 1 ))
629
+ (and (not (eq (point ) beginning-of-current-line))
630
+ (not (looking-at-p " ," ))
631
+ (not (php-in-string-or-comment-p))))
632
+ '+ )
633
+ (t nil ))))))
611
634
612
635
(defun php-c-looking-at-or-maybe-in-bracelist (&optional _containing-sexp lim )
613
636
" Replace `c-looking-at-or-maybe-in-bracelist' .
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ PHP_VERSION_ID > 80000
4
+ ? 'foo '
5
+ : 'bar ' ;
6
+
7
+ $ a = [
8
+ 'key ' => PHP_VERSION_ID > 80000
9
+ ? 'foo '
10
+ : 'bar ' ,
11
+ true &&
12
+ false ,
13
+ false
14
+ || true ,
15
+ 'value1 '
16
+ ,
17
+ 'value2 '
18
+ ,
19
+ ];
20
+
21
+ var_dump (
22
+ PHP_VERSION_ID > 80000
23
+ ? 'foo '
24
+ : 'bar ' ,
25
+ true && // ###php-mode-test### ((indent 4))
26
+ false ,
27
+ false // ###php-mode-test### ((indent 4))
28
+ || true , // ###php-mode-test### ((indent 8))
29
+ // ###php-mode-test### ((indent 4))
30
+ 1 // ###php-mode-test### ((indent 4))
31
+ + 2 // ###php-mode-test### ((indent 8))
32
+ / 3 , // ###php-mode-test### ((indent 8))
33
+ 'value1 ' // ###php-mode-test### ((indent 4))
34
+ , // ###php-mode-test### ((indent 4))
35
+ 'value2 ' // ###php-mode-test### ((indent 4))
36
+ , // ###php-mode-test### ((indent 4))
37
+ );
Original file line number Diff line number Diff line change @@ -646,6 +646,10 @@ Meant for `php-mode-test-issue-503'."
646
646
" Proper alignment object -> accessor."
647
647
(with-php-mode-test (" indent/issue-623.php" :indent t :magic t )))
648
648
649
+ (ert-deftest php-mode-test-issue-702 ()
650
+ " Proper alignment arglist."
651
+ (with-php-mode-test (" indent/issue-702.php" :indent t :magic t )))
652
+
649
653
(ert-deftest php-mode-test-php74 ()
650
654
" Test highlighting language constructs added in PHP 7.4."
651
655
(with-php-mode-test (" 7.4/arrow-function.php" :faces t ))
You can’t perform that action at this time.
0 commit comments