File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,7 @@ fn identify_comment(
321
321
// for a block comment, search for the closing symbol
322
322
CommentStyle :: DoubleBullet | CommentStyle :: SingleBullet | CommentStyle :: Exclamation => {
323
323
let closer = style. closer ( ) . trim_start ( ) ;
324
+ let mut count = orig. matches ( closer) . count ( ) ;
324
325
let mut closing_symbol_offset = 0 ;
325
326
let mut hbl = false ;
326
327
let mut first = true ;
@@ -341,7 +342,10 @@ fn identify_comment(
341
342
first = false ;
342
343
}
343
344
if trimmed_line. ends_with ( closer) {
344
- break ;
345
+ count -= 1 ;
346
+ if count == 0 {
347
+ break ;
348
+ }
345
349
}
346
350
}
347
351
( hbl, closing_symbol_offset)
Original file line number Diff line number Diff line change
1
+ /*code
2
+ /*code*/
3
+ if true {
4
+ println!("1");
5
+ }*/
Original file line number Diff line number Diff line change
1
+ /*code
2
+ /*code*/
3
+ if true {
4
+ println!("1");
5
+ }*/
You can’t perform that action at this time.
0 commit comments