Opened 12 years ago

Closed 11 years ago

Last modified 47 years ago

#239 closed Feature Requests (None)

Formatter: keep strings on multiple lines

Reported by: largegreenwood Owned by: nobody
Priority: 5 Milestone:
Component: None Version: None
Keywords: Cc:


hi there,

this came up in the forums and the original poster
seems to not have opened a RFE - or it has already been
handled, in that case I'm sorry for double-posting.

When using the formatter, something like:

$string= "bla blabla" .
           "bla blabla";

is formatted to:

$string= "bla blabla" . "bla blabla";

which would be OK if not PHPeclipse itself would have
the feature to easily split strings apart by simply
pressing enter and PHPeclipse does the ".\" stuff :)

the strange thing is, there is even an option to set a
maximum line length in formatter preferences, but it is
totally ignored?

Change History (3)

comment:1 Changed 12 years ago by brill1977

Logged In: YES 

you can deactivate the '. .' after return in editor typing
with the optrion Warp singel quated php strings

comment:2 Changed 11 years ago by nobody

Logged In: NO 


But that's not what this request is about: sure, turning off
the automatic concat when you hit enter might be useful, but
the formatter will still change multiline strings into
single line ones (while ignoring the maximum line length),
and that's the problem this person is experiencing. In
short, yes, you can turn that off, but no, the formatter
doesn't yet let you keep multiline strings.

comment:3 Changed 11 years ago by bananeweizen

  • Status changed from assigned to closed
Logged In: YES 

Implemented in CVS-2006-01-10. The line breaks are no longer
removed after the dot operator. The following lines will be
indented like the line where the concatenation starts. E.g.
the formatting result looks like:

function test() {
    $string = "bla blabla" .
    "bla blabla" .
    "bla blabla";

Additionally the there is now a space before and after the
dot operator, so single line concatenation looks like:
$string = "bla blabla" . "bla blabla";
Note: See TracTickets for help on using tickets.