patch 9.1.0631: wrong completion list displayed with non-existing dir + fuzzy completion
Problem: wrong completion list displayed with non-existing dir + fuzzy
completion (kawarimidoll)
Solution: clear list of matches, if leader did not use fuzzy match
(glepnir)
fixes: #15357
closes: #15365
Signed-off-by: glepnir <glephunter@gmail.com>
diff --git a/src/insexpand.c b/src/insexpand.c
index 7a5298f..2a5f8e8 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -3581,6 +3581,7 @@
// Move leader to the file part
leader = last_sep + 1;
+ leader_len = STRLEN(leader);
}
}
}
@@ -3643,12 +3644,18 @@
matches = sorted_matches;
num_matches = fuzzy_indices.ga_len;
}
+ else if (leader_len > 0)
+ {
+ FreeWild(num_matches, matches);
+ num_matches = 0;
+ }
vim_free(compl_fuzzy_scores);
ga_clear(&fuzzy_indices);
}
- ins_compl_add_matches(num_matches, matches, p_fic || p_wic);
+ if (num_matches > 0)
+ ins_compl_add_matches(num_matches, matches, p_fic || p_wic);
}
/*