From 291d1fbf1bbcb80fa9c21ff5ce46dbfc2102c71f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 17 Sep 2020 18:35:04 +0200 Subject: [PATCH] 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 --- src/reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reader.cpp b/src/reader.cpp index d495cdc6b..ed7903337 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -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) {