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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user