fix Removed indentation after nested comments error
This commit is contained in:
parent
bfcfaf1743
commit
5fcb7507ca
3 changed files with 15 additions and 1 deletions
|
@ -321,6 +321,7 @@ fn identify_comment(
|
|||
// for a block comment, search for the closing symbol
|
||||
CommentStyle::DoubleBullet | CommentStyle::SingleBullet | CommentStyle::Exclamation => {
|
||||
let closer = style.closer().trim_start();
|
||||
let mut count = orig.matches(closer).count();
|
||||
let mut closing_symbol_offset = 0;
|
||||
let mut hbl = false;
|
||||
let mut first = true;
|
||||
|
@ -341,7 +342,10 @@ fn identify_comment(
|
|||
first = false;
|
||||
}
|
||||
if trimmed_line.ends_with(closer) {
|
||||
break;
|
||||
count -= 1;
|
||||
if count == 0 {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
(hbl, closing_symbol_offset)
|
||||
|
|
5
tests/source/issue-3314.rs
Normal file
5
tests/source/issue-3314.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
/*code
|
||||
/*code*/
|
||||
if true {
|
||||
println!("1");
|
||||
}*/
|
5
tests/target/issue-3314.rs
Normal file
5
tests/target/issue-3314.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
/*code
|
||||
/*code*/
|
||||
if true {
|
||||
println!("1");
|
||||
}*/
|
Loading…
Reference in a new issue