mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Clear the autosuggestion from the old commandline when showing the completion list. Fixes #561
This commit is contained in:
parent
b9ba227733
commit
f1d923714a
1 changed files with 12 additions and 0 deletions
12
reader.cpp
12
reader.cpp
|
@ -543,6 +543,15 @@ static void reader_repaint()
|
|||
data->repaint_needed = false;
|
||||
}
|
||||
|
||||
static void reader_repaint_without_autosuggestion()
|
||||
{
|
||||
const wcstring saved_autosuggestion = data->autosuggestion;
|
||||
|
||||
data->autosuggestion.clear();
|
||||
reader_repaint();
|
||||
data->autosuggestion = saved_autosuggestion;
|
||||
}
|
||||
|
||||
/**
|
||||
Internal helper function for handling killing parts of text.
|
||||
*/
|
||||
|
@ -1743,6 +1752,9 @@ static bool handle_completions(const std::vector<completion_t> &comp)
|
|||
parse_util_get_parameter_info(data->command_line, data->buff_pos, "e, NULL, NULL);
|
||||
is_quoted = (quote != L'\0');
|
||||
|
||||
/* Clear the autosuggestion from the old commandline before abandoning it (see #561) */
|
||||
reader_repaint_without_autosuggestion();
|
||||
|
||||
write_loop(1, "\n", 1);
|
||||
|
||||
run_pager(prefix, is_quoted, comp);
|
||||
|
|
Loading…
Reference in a new issue