File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -637,7 +637,7 @@ impl CodeMap {
637
637
/// Finds the width of a character, either before or after the provided span.
638
638
fn find_width_of_character_at_span ( & self , sp : Span , forwards : bool ) -> u32 {
639
639
// Disregard malformed spans and assume a one-byte wide character.
640
- if sp. lo ( ) > sp. hi ( ) {
640
+ if sp. lo ( ) >= sp. hi ( ) {
641
641
return 1 ;
642
642
}
643
643
@@ -671,11 +671,16 @@ impl CodeMap {
671
671
} else {
672
672
return 1 ;
673
673
} ;
674
+ debug ! ( "DTW start {:?} end {:?}" , start_index, end_index) ;
675
+ debug ! ( "DTW snippet {:?}" , snippet) ;
674
676
675
677
let mut target = if forwards { end_index + 1 } else { end_index - 1 } ;
678
+ debug ! ( "DTW initial target {:?}" , target) ;
676
679
while !snippet. is_char_boundary ( target - start_index) {
677
680
target = if forwards { target + 1 } else { target - 1 } ;
681
+ debug ! ( "DTW update target {:?}" , target) ;
678
682
}
683
+ debug ! ( "DTW final target {:?}" , target) ;
679
684
680
685
if forwards {
681
686
( target - end_index) as u32
You can’t perform that action at this time.
0 commit comments