From 2885c085d8da65156001592cca1bb3e3002b164b Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 25 May 2016 21:23:50 +0200 Subject: Allow autosuggestion after completion It seems kinda silly to not directly do it, but it was explicitly stopped in the code. I'm quite good at deleting that, aren't I? Fixes #3016. --- src/reader.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/reader.cpp b/src/reader.cpp index 47258c64..6b23e129 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1127,9 +1127,6 @@ static void completion_insert(const wchar_t *val, complete_flags_t flags) { wcstring new_command_line = completion_apply_to_command_line(val, flags, el->text, &cursor, false /* not append only */); reader_set_buffer_maintaining_pager(new_command_line, cursor); - - // Since we just inserted a completion, don't immediately do a new autosuggestion. - data->suppress_autosuggestion = true; } struct autosuggestion_context_t { @@ -2775,15 +2772,15 @@ const wchar_t *reader_readline(int nchars) { // Evaluate. If the current command is unfinished, or if the charater is escaped using a // backslash, insert a newline. case R_EXECUTE: { - // Delete any autosuggestion. - data->autosuggestion.clear(); - // If the user hits return while navigating the pager, it only clears the pager. if (data->is_navigating_pager_contents()) { clear_pager(); break; } + // Delete any autosuggestion. + data->autosuggestion.clear(); + // The user may have hit return with pager contents, but while not navigating them. // Clear the pager in that event. clear_pager(); -- cgit v1.2.3