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

Issue with line break and auto formatting from the IDE #238

Closed
ydemartino opened this issue Aug 27, 2021 · 4 comments · Fixed by #284
Closed

Issue with line break and auto formatting from the IDE #238

ydemartino opened this issue Aug 27, 2021 · 4 comments · Fixed by #284
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ydemartino
Copy link

Hello, I noticed an issue with the strings.xml file when the line goes past the 100 characters limit.

What happens, is that I type my string like this:

    <string name="long_string">This is a super long string that goes past the 100 characters long and it will be automatically wrapped by the IDE</string>

And then it gets auto formatted by the IDE like this:

    <string name="long_string">This is a super long string that goes past the 100 characters long
        and it will be automatically wrapped by the IDE
    </string>

This is working fine on standard android project, but here is the generated multiplarform_strings.xml:

	<string name="long_string">This is a super long string that goes past the 100 characters long\n        and it will be automatically wrapped by the IDE\n    </string>

It adds hard line break and my text is now split across multiple lines... I think, the transformation to multiplatform_strings.xml should not add any \n. In strings.xml if we want to add an explicit line break, we need to use \n. The generation should keep the string as it was typed.

@Alex009
Copy link
Member

Alex009 commented Aug 31, 2021

line break added because new line found :) i think this issue resolve by IDE configuration, but not plugin changes

@Alex009 Alex009 self-assigned this Aug 31, 2021
@ydemartino
Copy link
Author

I understand what you are saying, I think this is a shame because then, we cannot reuse raw android files with moko resources...

@Alex009 Alex009 added the bug Something isn't working label Oct 18, 2021
@Alex009 Alex009 added this to the 0.17.3 milestone Oct 18, 2021
@Alex009 Alex009 removed this from the 0.17.3 milestone Dec 4, 2021
@Alex009 Alex009 removed the bug Something isn't working label Dec 4, 2021
@Alex009 Alex009 removed their assignment Dec 4, 2021
@Alex009 Alex009 added the enhancement New feature or request label Dec 4, 2021
@Alex009 Alex009 added this to the 0.18.0 milestone Jan 14, 2022
@Alex009 Alex009 linked a pull request Jan 14, 2022 that will close this issue
@Alex009 Alex009 modified the milestones: 0.18.0, 0.19.0 Jan 22, 2022
@Alex009
Copy link
Member

Alex009 commented Mar 14, 2022

@y9san9 here should be added new gradle.properties property for toggl new and old behaviour.

y9san9 added a commit that referenced this issue Mar 21, 2022
y9san9 added a commit that referenced this issue Mar 21, 2022
# Conflicts:
#	resources-generator/src/main/kotlin/dev/icerock/gradle/MultiplatformResourcesPlugin.kt
#	resources-generator/src/main/kotlin/dev/icerock/gradle/generator/PluralsGenerator.kt
#	resources-generator/src/main/kotlin/dev/icerock/gradle/generator/StringsGenerator.kt
#	resources-generator/src/main/kotlin/dev/icerock/gradle/generator/jvm/JvmPluralsGenerator.kt
#	resources-generator/src/main/kotlin/dev/icerock/gradle/generator/jvm/JvmStringsGenerator.kt
Alex009 added a commit that referenced this issue Mar 23, 2022
#238 changed default behavior - ignore new lines in xml
@Alex009
Copy link
Member

Alex009 commented Mar 23, 2022

will be released in 0.19.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants