diff options
author | Yannis Chatzimichos <feedward@gmail.com> | 2013-02-18 08:20:31 +0200 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-02-20 18:07:38 -0800 |
commit | f1d923714a0d53f6d91ef6ba10dfa0360c1e7007 (patch) | |
tree | 3ef98d7ff5a455c25daddf3552b675bbacd42192 /reader.cpp | |
parent | b9ba227733ed5beb1a343035ad0d5602864328cf (diff) |
Clear the autosuggestion from the old commandline when showing the completion list. Fixes #561
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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); |