0
0
mirror of https://github.com/vim/vim.git synced 2025-11-16 23:24:03 -05:00

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>
This commit is contained in:
glepnir
2024-07-27 16:25:45 +02:00
committed by Christian Brabandt
parent f0ce176b5f
commit 6b6280c4a2
4 changed files with 35 additions and 1 deletions

View File

@@ -3581,6 +3581,7 @@ get_next_filename_completion(void)
// Move leader to the file part
leader = last_sep + 1;
leader_len = STRLEN(leader);
}
}
}
@@ -3643,12 +3644,18 @@ get_next_filename_completion(void)
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);
}
/*