php-mode icon indicating copy to clipboard operation
php-mode copied to clipboard

array indent is not good

Open bugcook opened this issue 14 years ago • 4 comments

it's too long, maybe it's my problem. http://emacswiki.org/emacs/PhpMode#toc16 Some one solve this in emacs wiki.

bugcook avatar May 28 '12 03:05 bugcook

Could you show an example of how it looks when you try to indent it with Emacs, and what you think it should look like?

alinnow avatar May 28 '12 11:05 alinnow

With my Emacs,

$post=Post::model()->find(array(
                              'select'=>'title',
                              'condition'=>'postID=:postID',
                              'params'=>array(':postID'=>10),
                              ));

And i think it might be more good looking to:

$post=Post::model()->find(array(
    'select'=>'title',
    'condition'=>'postID=:postID',
    'params'=>array(':postID'=>10),
));

bugcook avatar May 29 '12 00:05 bugcook

I have nothing against adding a change like this so I'll try out the code on Emacs Wiki and see how it affects things in general. In your example I agree the second block of code is more readable, so I think it would be preferable to support that.

ejmr avatar May 29 '12 02:05 ejmr

I have pushed a patch to modify indentation so it works this way. Thanks eorza for the suggestion. I like this change better.

ejmr avatar May 30 '12 03:05 ejmr