Adam
Adam

Reputation: 5455

Eclipse formatter putting method on new line despite enough space in line width

I'm using Eclipse Luna 4.4.0 and Eclipse formatter takes this code:

            users = getSingleColUserList(new XSSFWorkbook(fileInputStream),
                            userId, profCol);

and drops the method call onto a new line:

            users =
                    getSingleColUserList(new XSSFWorkbook(fileInputStream),
                            userId, profCol);

As you can see, the line width is not the issue. It's not at all obvious what setting in the formatter dialog I need to change.

[UPDATED after Seelenvirtuose's answer]

I can set Eclipse to format Line Wrapping -> Assignments to Do not wrap. However that raises another issue with lines then not getting wrapped when they go over the line width:

    List<Map<String, Object>> emailMap = jdbcTemplate.queryForList(DBQueries.LOAD_EMAILS);

The line width is 80 which is either the s or the . of DBQueries so it should be:

    List<Map<String, Object>> emailMap = jdbcTemplate.queryForList(
                    DBQueries.LOAD_EMAILS);

None of the settings that I have tested for Line Wrapping -> Function Calls -> Arguments

It's cute that my browser is currently displaying a scrollbar under the unwrapped code!

Upvotes: 2

Views: 2315

Answers (1)

Seelenvirtuose
Seelenvirtuose

Reputation: 20658

It is the formatter's setting for "Line Wrapping -> Assignments". Set it to "Do not wrap".

enter image description here

Upvotes: 2

Related Questions