Have the pager use the correct prefix for case-corrected completions

Follow-up to 28d67c8f which only fixed inserting such completions.
This commit is contained in:
Johannes Altmanninger
2020-07-20 00:33:17 +02:00
parent a61e97a8b9
commit b3485d2457

View File

@@ -1821,7 +1821,7 @@ bool reader_data_t::handle_completions(const completion_list_t &comp, size_t tok
// Print the completion list. // Print the completion list.
wcstring prefix; wcstring prefix;
if (will_replace_token || match_type_requires_full_replacement(best_match_type)) { if (will_replace_token || match_type_requires_full_replacement(best_match_type)) {
prefix.clear(); // no prefix if (use_prefix) prefix = std::move(common_prefix);
} else if (tok.size() + common_prefix.size() <= PREFIX_MAX_LEN) { } else if (tok.size() + common_prefix.size() <= PREFIX_MAX_LEN) {
prefix = tok + common_prefix; prefix = tok + common_prefix;
} else { } else {