Fix panic! caused by bad utf16 clipping (#7530)

Release Notes:

- Fixed a panic in diagnostics with emojis

**or**

- N/A
This commit is contained in:
Conrad Irwin 2024-02-07 16:35:30 -07:00 committed by GitHub
parent 374c8a4c8c
commit f55aba51ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3987,7 +3987,7 @@ impl Project {
range.end = snapshot.clip_point_utf16(Unclipped(range.end), Bias::Right);
if range.start == range.end && range.end.column > 0 {
range.start.column -= 1;
range.end = snapshot.clip_point_utf16(Unclipped(range.end), Bias::Left);
range.start = snapshot.clip_point_utf16(Unclipped(range.start), Bias::Left);
}
}