Recompute completions if previous attempt failed

When pressing tab repeatedly, completions only computed on the first one. This
is because the old logic assumed that completions are present if the last
key was tab. Recompute them if there are no completions at all.

Fixes #6863
This commit is contained in:
Johannes Altmanninger 2020-09-17 18:35:04 +02:00
parent 6ec0b583f5
commit 291d1fbf1b

View file

@ -2814,7 +2814,7 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
// Use the command line only; it doesn't make sense to complete in any other line.
editable_line_t *el = &command_line;
if (is_navigating_pager_contents() ||
(!rls.complete_did_insert && rls.last_cmd == rl::complete)) {
(!rls.comp.empty() && !rls.complete_did_insert && rls.last_cmd == rl::complete)) {
// The user typed complete more than once in a row. If we are not yet fully
// disclosed, then become so; otherwise cycle through our available completions.
if (current_page_rendering.remaining_to_disclose > 0) {