Skip to content

Commit 28e0b42

Browse files
estebankcuviper
authored andcommitted
Fix next_point to be unicode aware
(cherry picked from commit 3250057)
1 parent 9b23f7c commit 28e0b42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libsyntax_pos/source_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ impl SourceMap {
739739
pub fn next_point(&self, sp: Span) -> Span {
740740
let start_of_next_point = sp.hi().0;
741741

742-
let width = self.find_width_of_character_at_span(sp, true);
742+
let width = self.find_width_of_character_at_span(sp.shrink_to_hi(), true);
743743
// If the width is 1, then the next span should point to the same `lo` and `hi`. However,
744744
// in the case of a multibyte character, where the width != 1, the next span should
745745
// span multiple bytes to include the whole character.

0 commit comments

Comments
 (0)