mirror of https://github.com/lapce/lapce.git
Fix auto-completion crash (#1366)
This commit is contained in:
parent
61dd0b6e4b
commit
241341b3c0
|
@ -106,9 +106,7 @@ pub fn generate_edits(
|
||||||
|
|
||||||
// We have to keep track of a shift because the deletions aren't properly moved forward
|
// We have to keep track of a shift because the deletions aren't properly moved forward
|
||||||
let mut shift = insertions.inserts_len();
|
let mut shift = insertions.inserts_len();
|
||||||
// I believe this is the correct `CountMatcher` to use for this iteration, since it is what they use
|
for (start, end) in deletions.range_iter(CountMatcher::NonZero) {
|
||||||
// for deleting a subset from a string.
|
|
||||||
for (start, end) in deletions.range_iter(CountMatcher::Zero) {
|
|
||||||
edits.push(create_delete_edit(&text, start + shift, end + shift));
|
edits.push(create_delete_edit(&text, start + shift, end + shift));
|
||||||
|
|
||||||
let delete_delta = RopeDelta::simple_edit(
|
let delete_delta = RopeDelta::simple_edit(
|
||||||
|
|
Loading…
Reference in New Issue