mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-26 05:44:26 +00:00
Fix next_point
to be unicode aware
This commit is contained in:
parent
fcd850fc5d
commit
3250057da9
@ -710,7 +710,7 @@ impl SourceMap {
|
||||
pub fn next_point(&self, sp: Span) -> Span {
|
||||
let start_of_next_point = sp.hi().0;
|
||||
|
||||
let width = self.find_width_of_character_at_span(sp, true);
|
||||
let width = self.find_width_of_character_at_span(sp.shrink_to_hi(), true);
|
||||
// If the width is 1, then the next span should point to the same `lo` and `hi`. However,
|
||||
// in the case of a multibyte character, where the width != 1, the next span should
|
||||
// span multiple bytes to include the whole character.
|
||||
|
Loading…
Reference in New Issue
Block a user