Skip to content

Chains tabbed indent #601

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

Merged
merged 1 commit into from
Nov 14, 2015
Merged

Conversation

thorbenk
Copy link
Contributor

When breaking chains, the indentation was too large in "Tabbed" mode. Is this the correct way to fix this?

@thorbenk thorbenk force-pushed the chains_tabbed_indent branch from 9cf3c08 to 8dac18e Compare November 14, 2015 16:59
@marcusklaas
Copy link
Contributor

That doesn't look right to me. If I remember correctly, the chain_base_indent option was created to set the indentation of chain bases which ended in a nearly blank line.

For example:

match x {
    Some(val) => val,
    None => default,
}
    .this_is_tabbed_mode();

@marcusklaas
Copy link
Contributor

Could you post the example (input, output) which prompted this pull request?

@thorbenk
Copy link
Contributor Author

Thanks for your explanation! Without a rustfmt.toml, rustfmt changes my code like this:

 pub fn read_and_rotate(img_filename: &Path) -> DynamicImage {
     let exif_orientation = rexiv2::Metadata::new_from_path(img_filename.to_str().unwrap())
-        .map(|e| e.get_orientation());
+                               .map(|e| e.get_orientation());

(You can also take the test from my commit as an example)

I'm not sure why it is indented so heavily (and to what reference column the aligning happens here), but guessed that this is due to the "Visual" default settings. I would like to just indent once here, like in the "Tabbed" modes. With this, I'm leaning towards a style as described in #454.

@marcusklaas
Copy link
Contributor

Aha! There's no option to change this behaviour at this moment. Could you create a new one of the same type and check for that? I think you'd also have to consider Inherit, but that's just one level of indentation less deep than Tabbed.

@thorbenk thorbenk force-pushed the chains_tabbed_indent branch from 8dac18e to d4be6a4 Compare November 14, 2015 20:52
@thorbenk
Copy link
Contributor Author

OK, pushed a new version. Does that go in the right direction?

@marcusklaas
Copy link
Contributor

Perfect! Thanks for the changes.

marcusklaas added a commit that referenced this pull request Nov 14, 2015
@marcusklaas marcusklaas merged commit de59901 into rust-lang:master Nov 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants