Fix auto-completion crash (#1366)

This commit is contained in:
Gökhan Karabulut 2022-09-27 21:42:12 +03:00 committed by GitHub
parent 61dd0b6e4b
commit 241341b3c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -106,9 +106,7 @@ pub fn generate_edits(
// We have to keep track of a shift because the deletions aren't properly moved forward
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 deleting a subset from a string.
for (start, end) in deletions.range_iter(CountMatcher::Zero) {
for (start, end) in deletions.range_iter(CountMatcher::NonZero) {
edits.push(create_delete_edit(&text, start + shift, end + shift));
let delete_delta = RopeDelta::simple_edit(