Fix bugs with multicursor completions (#28586)

Release Notes:

- Fixed completions with multiple cursors leaving duplicated prefixes.
- Fixed crash when accepting a completion in a multibuffer with multiple
cursors.
- Vim: improved `single-repeat` after accepting a completion, now
pressing `.` to replay the completion will re-insert the completion text
at the cursor position.
This commit is contained in:
João Marcos 2025-04-14 15:09:28 -03:00 committed by GitHub
parent 47b663a8df
commit ff41be30dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 341 additions and 76 deletions

View file

@ -7694,7 +7694,12 @@ impl ToOffset for Point {
impl ToOffset for usize {
#[track_caller]
fn to_offset<'a>(&self, snapshot: &MultiBufferSnapshot) -> usize {
assert!(*self <= snapshot.len(), "offset is out of range");
assert!(
*self <= snapshot.len(),
"offset {} is greater than the snapshot.len() {}",
*self,
snapshot.len(),
);
*self
}
}