You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Stumbled upon this. Was adding some KDoc comments based on some text from elsewhere. That text had 2 spaces after a period and that happened to be where the line breaking algorithm broke the text but it resulted in a trailing whitespace on the line. This can be annoying because the IDE likes to remove them and in our case the generated code will be checked into git causing diffs
To Reproduce
Adding this line to a top level function spec will show it:
I wonder if there are use cases where trailing whitespaces can be meaningful, and whether we'd be breaking those use cases by deleting whitespaces by default. I wouldn't want to us to introduce a parameter to control this behaviour either. Perhaps it's safer to leave this decision to library consumers?
In my case it is text coming from a swagger spec and whoever wrote it was following the old 2 spaces after a period convention.
Regarding the notion of preserving spaces in a monospace span the line wrapping itself would be a problem any way so whether you leave a trailing whitespace seems moot for that case.
Describe the bug
Stumbled upon this. Was adding some KDoc comments based on some text from elsewhere. That text had 2 spaces after a period and that happened to be where the line breaking algorithm broke the text but it resulted in a trailing whitespace on the line. This can be annoying because the IDE likes to remove them and in our case the generated code will be checked into git causing diffs
To Reproduce
Adding this line to a top level function spec will show it:
Note that there are 2 spaces after the period.
The output will be:
which has a space at the end of the first line
Expected behavior
I expect the generated code to have no trailing whitespace
Additional context
My workaround is to collapse multiple spaces to 1
The text was updated successfully, but these errors were encountered: