Automatically indent below above line after CR (in arguments list)

That must be easy but can't figure out how to do this:

Function declaration:

function calculRatio(temperature,   
elevation, // doing CR here...
torque, // gets the cursor under 'e' of 'elevation' automatically
speed) { // and here under 't' of 'torque'
...

Function call:

calculRatio(-273.15,     
4807, // doing CR here...
12345, // gets the cursor under '4' of '4807' automatically
800); // and here under '1' of '12345'
...

Array declaration:

$array = [ 'john', 'smith',
35, 'LA', // doing CR here...
'interpreter', // gets the cursor under '3' of '35' automatically
2016 ]; // and here under opening quote of 'interpreter'
...

Is there a way in the Settings to accomplish this?

Meaning going directly under the beginning of the previous line in case we are in an unterminated statement (list of items / arguments....), and the previous line is an argument (of course that would be even better if PS could recognize where is the 1st argument/item of the list - after the function/array... declaration - and, after a CR, put the cursor at its level.

It's what Emacs does by default in most languages, if that helps.

 

 

2 comments
Comment actions Permalink

Hello,

Please try to disable File | Settings | Editor | General | Smart Keys | Enter > Smart indent option and check if that fixes the behavior.

1
Comment actions Permalink

Hello

that seems to work.

However, won't that affect other "smart" behavior that was helpful?

Keep this for now, thanks!

0

Please sign in to leave a comment.