From: Vincenzo Pupillo Date: Fri, 21 Jun 2024 21:24:33 +0000 (+0200) Subject: Support for indentation of PHP alternative syntax control structures X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1350deb2ec20f7697f22cc39bd5262b76de989f6;p=emacs.git 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) (cherry picked from commit 155cc89de0266e28b68fdecfdc2a0a40b9d79001) --- 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." ;; 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")