>From 45f6c668bdf0b88227db8de3576a2c6408966c49 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Fri, 21 Jun 2024 23:24:33 +0200 Subject: [PATCH] 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. --- lisp/progmodes/php-ts-mode.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 8bb18dab3d5..415ba695158 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -651,6 +651,12 @@ php-ts-mode--indent-styles ;; These rules are for cases where the body is bracketless. ((match "while" "do_statement") parent-bol 0) + ;; rule for PHP alternative syntax + ((or (node-is "else_if_clause") + (node-is "endif") + (node-is "endforeach") + (node-is "endwhile")) + parent-bol 0) ((or (parent-is "if_statement") (parent-is "else_clause") (parent-is "for_statement") -- 2.45.2