Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the options to format keeping line breaks #32

Closed
vigdorchik opened this issue Oct 6, 2011 · 6 comments
Closed

Add the options to format keeping line breaks #32

vigdorchik opened this issue Oct 6, 2011 · 6 comments

Comments

@vigdorchik
Copy link
Member

Currently scalariform doesn't respect explicit line breaks, and as a result produces the results I don't want.
Would be nice if an option like keepLineBreaks could be added.

@mdr
Copy link
Collaborator

mdr commented Oct 6, 2011

Unfortunately, to explicitly retain line-breaks (and then do an appropriate indent) at arbitrary locations requires a moderate amount of rework of the formatter -- which I definitely want to do at some point, but it's a long term feature. Are there any cases that are of particular issue to you? It's relatively easy to fix individual scenarios.

@vigdorchik
Copy link
Member Author

Thank you for explaining, it's not an urgent need, but it would be nice if it were supported at some point. If you want to fix individual cases, then my biggest pain point is scalariform moving:
(
a_long_line &&
b_long_line
)

to

(a_long_line &&
b_long_line)

which I find notpretty at all...

@vigdorchik
Copy link
Member Author

The indents were eaten, seems I have to learn github markup.

@mdr
Copy link
Collaborator

mdr commented Oct 7, 2011

No problem, I've opened issue #33 for your particular case.

@nairbv
Copy link

nairbv commented Jan 15, 2013

I'm also looking for a way to preserve line breaks.

My specific situation where I'd like to preserve line breaks is in code that looks like:

def myfunciton(someVeryLongParameterNames:AndALongTypeName)      
                         (WithAnotherLongCurriedParameterThatIdLikeToHaveOn : TheNextLine)
                         : AndSinceItsSoLongPutTheReturnTypeAnnotationDownHere = 
{
  //the method
}

In my code base I'm finding single lines of code that are hundreds of characters long, making them unreadable. I'd like to have ways to shorten function and class declarations by adding line breaks, but I can't find an option to preserve them.

@godenji
Copy link
Collaborator

godenji commented Oct 25, 2017

fixed in 0.2.4

@godenji godenji closed this as completed Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants