supermaven: Fix incorrect offset calculation (#17925)
Fixes a bug in https://github.com/zed-industries/zed/pull/17578 when computing the offset. Specifically, `offset.add_assign()` should be incremented on every loop match instead of only when the completion text is found. Before:  After:  Release Notes: - Fixed a wrong offset calculation in the Supermaven inline completion provider.
This commit is contained in:
parent
f1d21362fa
commit
c48584fb79
1 changed files with 1 additions and 1 deletions
|
@ -77,10 +77,10 @@ fn completion_state_from_diff(
|
|||
snapshot.anchor_after(offset),
|
||||
completion_text[i..i + k].into(),
|
||||
));
|
||||
offset.add_assign(j);
|
||||
}
|
||||
i += k + 1;
|
||||
j += 1;
|
||||
offset.add_assign(1);
|
||||
}
|
||||
None => {
|
||||
// there are no more matching completions, so drop the remaining
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue