Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow suggestions more often #3069

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/reader.cpp
Expand Up @@ -530,9 +530,6 @@ void reader_data_t::pager_selection_changed() {
}
reader_set_buffer_maintaining_pager(new_cmd_line, cursor_pos);

// Since we just inserted a completion, don't immediately do a new autosuggestion.
this->suppress_autosuggestion = true;

// Trigger repaint (see issue #765).
reader_repaint_needed();
}
Expand Down Expand Up @@ -1132,9 +1129,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 {
Expand Down Expand Up @@ -2780,15 +2774,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();
Expand Down