Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perltidy indents too much when there are stacked opening tokens

by LanX (Saint)
on Oct 21, 2014 at 01:07 UTC ( [id://1104506]=note: print w/replies, xml ) Need Help??


in reply to Perltidy indents too much when there are stacked opening tokens

The current behavior is a good default, since stacked parens doesn't mean that all data is on the same depth (see discoverX ) and yes perltidy doesn't seem to have any finer control about data indentation.

$ perltidy -st -sct -sot tsttdy.pl sub discoverX { return [ { 'name' => $name, 'version' => $VERSION, }, [ 1, 2, 3 ] ]; } sub discover1 { return { 'name' => $name, 'version' => $VERSION, }; } sub discover2 { return [ { 'name' => $name, 'version' => $VERSION, } ]; } sub discover3 { return [ [ { 'name' => $name, 'version' => $VERSION, } ] ]; }

For what it's worth emacs has an option to calculate the indentation relative from the last statement:

sub discoverX { return [{ 'name' => $name, 'version' => $VERSION, }, [1,2,3] ]; }

Maybe you want to propose this feature to the maintainer?

I'm not too convinced. But YMMV ...

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104506]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found