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

Keep additional spaces #212

Open
julien-diener opened this issue Mar 9, 2016 · 1 comment
Open

Keep additional spaces #212

julien-diener opened this issue Mar 9, 2016 · 1 comment

Comments

@julien-diener
Copy link

I have seen some issues about alignment (eg #161 and #176) and I wanted to propose an other option to align comments, such as:

val x  = 2              // note the = align, see #176  
val fx = f(x).head  // the need only the first element

But then, I thought it'd be simpler to have an option such that scalariform only assert there are enough spaces (eg: one before and one after =), but let additional ones that the coder chose to write.

The same goes for additional blank lines.

Tell me if I can be of any help, or some hint on where to look in your code.

@jkinkead
Copy link
Collaborator

jkinkead commented Mar 9, 2016

For a global change like this, I think your best bet would be to alter how the formatter processes formatting instructions.

I think you'd need switches in the handling of CompactEnsuringGap and CompactPreservingGap, and append the existing whitespace tokens instead of the " " literals.

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

2 participants