aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincenzo Pupillo2024-06-21 23:24:33 +0200
committerEli Zaretskii2024-06-22 12:42:10 +0300
commit155cc89de0266e28b68fdecfdc2a0a40b9d79001 (patch)
tree2259c1664fca0cc3e242a799303d23a643efd122
parent11fb3510f48f3eeeca0bf5622c028c5138ba50f3 (diff)
downloademacs-155cc89de0266e28b68fdecfdc2a0a40b9d79001.tar.gz
emacs-155cc89de0266e28b68fdecfdc2a0a40b9d79001.zip
Support for indentation of PHP alternative syntax control structures
For some control structures, PHP provides an alternative syntax. A new rule has been added to handle this syntax. * lisp/progmodes/php-ts-mode.el (php-ts-mode--indent-styles): New rule for PHP alternative syntax. (Bug#71710)
-rw-r--r--lisp/progmodes/php-ts-mode.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el
index 71f51b23ebf..7171baf27c9 100644
--- a/lisp/progmodes/php-ts-mode.el
+++ b/lisp/progmodes/php-ts-mode.el
@@ -651,6 +651,12 @@ characters of the current line."
651 651
652 ;; These rules are for cases where the body is bracketless. 652 ;; These rules are for cases where the body is bracketless.
653 ((match "while" "do_statement") parent-bol 0) 653 ((match "while" "do_statement") parent-bol 0)
654 ;; rule for PHP alternative syntax
655 ((or (node-is "else_if_clause")
656 (node-is "endif")
657 (node-is "endforeach")
658 (node-is "endwhile"))
659 parent-bol 0)
654 ((or (parent-is "if_statement") 660 ((or (parent-is "if_statement")
655 (parent-is "else_clause") 661 (parent-is "else_clause")
656 (parent-is "for_statement") 662 (parent-is "for_statement")