File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -637,7 +637,7 @@ impl CodeMap {
637637 /// Finds the width of a character, either before or after the provided span.
638638 fn find_width_of_character_at_span ( & self , sp : Span , forwards : bool ) -> u32 {
639639 // Disregard malformed spans and assume a one-byte wide character.
640- if sp. lo ( ) > sp. hi ( ) {
640+ if sp. lo ( ) >= sp. hi ( ) {
641641 return 1 ;
642642 }
643643
@@ -671,11 +671,16 @@ impl CodeMap {
671671 } else {
672672 return 1 ;
673673 } ;
674+ debug ! ( "DTW start {:?} end {:?}" , start_index, end_index) ;
675+ debug ! ( "DTW snippet {:?}" , snippet) ;
674676
675677 let mut target = if forwards { end_index + 1 } else { end_index - 1 } ;
678+ debug ! ( "DTW initial target {:?}" , target) ;
676679 while !snippet. is_char_boundary ( target - start_index) {
677680 target = if forwards { target + 1 } else { target - 1 } ;
681+ debug ! ( "DTW update target {:?}" , target) ;
678682 }
683+ debug ! ( "DTW final target {:?}" , target) ;
679684
680685 if forwards {
681686 ( target - end_index) as u32
You can’t perform that action at this time.
0 commit comments