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:
parent
47b663a8df
commit
ff41be30dc
4 changed files with 341 additions and 76 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue