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

Fix line break being incorrectly added when preserveAttrLineBreaks is true #780

Merged
merged 1 commit into from
Jun 17, 2020
Merged

Conversation

xorye
Copy link

@xorye xorye commented Jun 11, 2020

While xml.format.preserveAttributeLineBreaks is enabled, in this case:

<a attr="value" attr="value"
    attr=
    "value" attr="value">
</a>

in master, formatting results in:

<a attr="value" attr="value"
    attr="value"
    attr="value">
</a>

There shouldn't be a newline after the 2nd line.

This PR fixes this problem. As a result, formatting now results in:

<a attr="value" attr="value"
    attr="value" attr="value">
</a>

Sorry, this should have been caught yesterday

Signed-off-by: David Kwon [email protected]

@xorye xorye added this to the 0.13.0 milestone Jun 11, 2020
@xorye xorye added the bug Something isn't working label Jun 11, 2020
@datho7561
Copy link
Contributor

datho7561 commented Jun 11, 2020

I get

<?xml version="1.0" encoding="UTF-8"?>
<a attr="value" attr="value"
    attr="value" attr="value"></a>

for

<?xml version="1.0" encoding="UTF-8"?>
<a attr="value" attr="value"
    attr=
    "value" attr="value">
</a>

Although, I think this is the right behaviour.

@xorye
Copy link
Author

xorye commented Jun 11, 2020

Yes, that's correct behaviour

@angelozerr angelozerr merged commit 7973e91 into eclipse-lemminx:master Jun 17, 2020
@xorye xorye changed the title Fix line break being incorrectly added when preserveAttrLineBreaks is Fix line break being incorrectly added when preserveAttrLineBreaks is true Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants