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

Incorrect whitespace when match_arm_blocks set to false #4003

Open
Cy-Tek opened this issue Jan 7, 2020 · 2 comments
Open

Incorrect whitespace when match_arm_blocks set to false #4003

Cy-Tek opened this issue Jan 7, 2020 · 2 comments
Labels
bug Panic, non-idempotency, invalid code, etc. e-trailing whitespace error[internal]: left behind trailing whitespace only-with-option requires a non-default option value to reproduce

Comments

@Cy-Tek
Copy link

Cy-Tek commented Jan 7, 2020

When the config option for match_arm_blocks is set to false, the formatter adds additional whitespace which causes errors saying: 'error[internal]: left behind trailing whitespace'

For example:

match pos_iter.peek()
    {
        Some(pos) if pos.0 != 0 =>
            add_paragraphs_to_map(&doc[0..pos.0], 0, current_level, &mut paragraphs),
        None => add_paragraphs_to_map(doc, 0, current_level, &mut paragraphs),
        _ => (),
    }

// becomes

match pos_iter.peek()
    {
        Some(pos) if pos.0 != 0 =>
        
            add_paragraphs_to_map(&doc[0..pos.0], 0, current_level, &mut paragraphs),
        None => add_paragraphs_to_map(doc, 0, current_level, &mut paragraphs),
        _ => (),
    }
@calebcartwright
Copy link
Member

This issue was discussed briefly in Discord, and confirmed to be reproducible on master as well

@topecongiro topecongiro added bug Panic, non-idempotency, invalid code, etc. only-with-option requires a non-default option value to reproduce labels Jan 9, 2020
@ytmimi ytmimi added the e-trailing whitespace error[internal]: left behind trailing whitespace label Jul 22, 2022
@ytmimi
Copy link
Contributor

ytmimi commented Jul 26, 2022

linking tracking issue for match_arm_blocks #3373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc. e-trailing whitespace error[internal]: left behind trailing whitespace only-with-option requires a non-default option value to reproduce
Projects
None yet
Development

No branches or pull requests

4 participants