Reformat code line break positioning to create similar length lines

I like the new behavior in 2020.1 that prefers to insert line breaks at concatenations over inside function call parentheses, but I'd like even more control.

When I have a long line, e.g.

print "lots of text " . $someLongName->evenMoreLongStrings("something else") . " we can have more text " . $something->else();

I would like to control where it would insert a line break, so it creates lines of similar length and ends up with

print "lots of text " . $someLongName->evenMoreLongStrings("something else")
       . " we can have more text " . $something->else();

instead of

print "lots of text " . $someLongName->evenMoreLongStrings("something else") . " we can have more text "
       . $something->else();

Is there an option that affects this that I have overlooked?

 

0
2 comments

Hi there,

AFAIK it should use right margin settings for this:

  • Defaults/Global: Settings/Preferences | Editor | Code Style | Hard Wrap At
  • PHP specific: Settings/Preferences | Editor | Code Style | PHP | Wrapping and Braces | Hard wrap at

Not sure if Visual Guides option affects this...

0

It does use "Hard Wrap At", I was just wondering if there is a way to create more balanced lines when they run long.

It's just a personal preference, and probably something that would be better suited to be handled in a plugin instead of adding complexity to the core product for something very few people will need.

0

Please sign in to leave a comment.