forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle hard tabs when formatting trailing comments (rust-lang#3836)
- Loading branch information
1 parent
33e3667
commit 160c3aa
Showing
6 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// rustfmt-version: Two | ||
// rustfmt-wrap_comments: true | ||
// rustfmt-hard_tabs: true | ||
|
||
impl Foo { | ||
fn foo() { | ||
bar(); // comment 1 | ||
// comment 2 | ||
// comment 3 | ||
baz(); | ||
} | ||
} | ||
|
||
fn lorem_ipsum() { | ||
let f = bar(); // Donec consequat mi. Quisque vitae dolor. Integer lobortis. Maecenas id nulla. Lorem. | ||
// Id turpis. Nam posuere lectus vitae nibh. Etiam tortor orci, sagittis malesuada, rhoncus quis, hendrerit eget, libero. Quisque commodo nulla at nunc. Mauris consequat, enim vitae venenatis sollicitudin, dolor orci bibendum enim, a sagittis nulla nunc quis elit. Phasellus augue. Nunc suscipit, magna tincidunt lacinia faucibus, lacus tellus ornare purus, a pulvinar lacus orci eget nibh. Maecenas sed nibh non lacus tempor faucibus. In hac habitasse platea dictumst. Vivamus a orci at nulla tristique condimentum. Donec arcu quam, dictum accumsan, convallis accumsan, cursus sit amet, ipsum. In pharetra sagittis nunc. | ||
let b = baz(); | ||
|
||
let normalized = self.ctfont.all_traits().normalized_weight(); // [-1.0, 1.0] | ||
// TODO(emilio): It may make sense to make this range [.01, 10.0], to align with css-fonts-4's range of [1, 1000]. | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// rustfmt-version: Two | ||
// rustfmt-wrap_comments: true | ||
// rustfmt-hard_tabs: true | ||
|
||
impl Foo { | ||
fn foo() { | ||
bar(); // comment 1 | ||
// comment 2 | ||
// comment 3 | ||
baz(); | ||
} | ||
} | ||
|
||
fn lorem_ipsum() { | ||
let f = bar(); // Donec consequat mi. Quisque vitae dolor. Integer lobortis. Maecenas id nulla. Lorem. | ||
// Id turpis. Nam posuere lectus vitae nibh. Etiam tortor orci, sagittis | ||
// malesuada, rhoncus quis, hendrerit eget, libero. Quisque commodo nulla at | ||
// nunc. Mauris consequat, enim vitae venenatis sollicitudin, dolor orci | ||
// bibendum enim, a sagittis nulla nunc quis elit. Phasellus augue. Nunc | ||
// suscipit, magna tincidunt lacinia faucibus, lacus tellus ornare purus, a | ||
// pulvinar lacus orci eget nibh. Maecenas sed nibh non lacus tempor faucibus. | ||
// In hac habitasse platea dictumst. Vivamus a orci at nulla tristique | ||
// condimentum. Donec arcu quam, dictum accumsan, convallis accumsan, cursus sit | ||
// amet, ipsum. In pharetra sagittis nunc. | ||
let b = baz(); | ||
|
||
let normalized = self.ctfont.all_traits().normalized_weight(); // [-1.0, 1.0] | ||
// TODO(emilio): It may make sense to make this range [.01, 10.0], to align | ||
// with css-fonts-4's range of [1, 1000]. | ||
} |
File renamed without changes.