Fix case-correcting completion stomping token on common prefix

The prefix has already been case-corrected at this point and the remaining
completions are for the suffix only.

Fixes #7211

Introduced in
28d67c8f Show completion list on Tab also if a common prefix was inserted
This commit is contained in:
Johannes Altmanninger
2020-07-19 23:36:53 +02:00
parent dff4f140b0
commit a61e97a8b9

View File

@@ -1812,6 +1812,7 @@ bool reader_data_t::handle_completions(const completion_list_t &comp, size_t tok
if (use_prefix) {
for (completion_t &c : surviving_completions) {
c.flags &= ~COMPLETE_REPLACES_TOKEN;
wcstring &comp = c.completion;
comp.erase(comp.begin(), comp.begin() + common_prefix.size());
}