Skip to content

Commit

Permalink
Indent ‘foreach’ construction without {} block after it
Browse files Browse the repository at this point in the history
So:

    foreach ($ar as $el)
        print $el;

Now indents properly.

Signed-off-by: Eric James Michael Ritz <[email protected]>
  • Loading branch information
zapad authored and Eric James Michael Ritz committed Dec 21, 2012
1 parent 7f02722 commit 89eefdf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ code and modules."
(set (make-local-variable 'c-basic-offset) 4)
(set (make-local-variable 'indent-tabs-mode) nil)
(c-set-offset 'block-open '-)
(c-set-offset 'block-close 0))
(c-set-offset 'block-close 0)
(c-set-offset 'statement-cont '+))

(defun php-enable-drupal-coding-style ()
"Makes php-mode use coding styles that are preferable for
Expand All @@ -295,7 +296,8 @@ working with Drupal."
(c-set-offset 'case-label '+)
(c-set-offset 'arglist-close 0)
(c-set-offset 'arglist-intro '+)
(c-set-offset 'arglist-cont-nonempty 'c-lineup-math))
(c-set-offset 'arglist-cont-nonempty 'c-lineup-math)
(c-set-offset 'statement-cont '+))

(defun php-enable-wordpress-coding-style ()
"Makes php-mode use coding styles that are preferable for
Expand All @@ -311,7 +313,8 @@ working with Wordpress."
(c-set-offset 'case-label 2)
(c-set-offset 'arglist-close 0)
(c-set-offset 'defun-close 0)
(c-set-offset 'defun-block-intro tab-width))
(c-set-offset 'defun-block-intro tab-width)
(c-set-offset 'statement-cont '+))


(defun php-mode-version ()
Expand Down

0 comments on commit 89eefdf

Please sign in to comment.