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

bugfix: unindent description misbehaviors #1707

Merged
merged 1 commit into from
Apr 25, 2017
Merged

Conversation

arlimus
Copy link
Contributor

@arlimus arlimus commented Apr 25, 2017

Unindent has been misbehaving for control descriptions by completely removing newlines. This is now fixed and the unindentation mechanism improved to behave as expected.

Removing empty lines at the beginning and end of string remains unchanged.
Tabs are not treated as multi-space indentations; supporting them as 8-space chars would require additional effort (please comment if this is important to you)

Signed-off-by: Dominik Richter [email protected]

@arlimus arlimus added Type: Bug Feature not working as expected in progress labels Apr 25, 2017
@arlimus
Copy link
Contributor Author

arlimus commented Apr 25, 2017

oh my, finally fixed this... 😁

end

it 'adds a multiline description' do
t = rand_string + "\n" + rand_string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example, this was not working with the old method, it would just replace the newline character

end

it 'strips empty lines and spaces in description at start and end' do
t = " \n" + rand_string + "\n "
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add tests for this behavior, make sure we don't break anyone unexpectedly

Unindent has been misbehaving for control `desc`riptions by completely removing newlines. This is now fixed and the unindentation mechanism improved to behave as expected.

Removing empty lines at the beginning and end of string remains unchanged.
Tabs are not treated as multi-space indentations; supporting them as 8-space chars would require additional effort (please comment if this is important to you)

Signed-off-by: Dominik Richter <[email protected]>
Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful. Thank you @arlimus

@chris-rock chris-rock merged commit 9252b61 into master Apr 25, 2017
@chris-rock chris-rock deleted the dr/fix-unindent branch April 25, 2017 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants