From 5b7b6eebafc025a33a2fba39f1873d4d09a04d86 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 5 Aug 2016 13:53:19 +0100 Subject: Regenerate shell-candidates for each completion sessions That should allow fixing the #665 issue while still avoiding to run a potentially long shell command on each keystroke. --- src/command_manager.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/command_manager.cc') diff --git a/src/command_manager.cc b/src/command_manager.cc index 7419e0bc..ef2fef5c 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -609,6 +609,11 @@ Completions CommandManager::complete(const Context& context, return Completions{}; const String& command_name = tokens[cmd_idx].content(); + if (command_name != m_last_complete_command) + { + m_last_complete_command = command_name; + flags |= CompletionFlags::Start; + } auto command_it = find_command(context, command_name); if (command_it == m_commands.end() or @@ -652,6 +657,11 @@ Completions CommandManager::complete(const Context& context, else { const String& command_name = params[0]; + if (command_name != m_last_complete_command) + { + m_last_complete_command = command_name; + flags |= CompletionFlags::Start; + } auto command_it = find_command(context, command_name); if (command_it != m_commands.end() and command_it->second.completer) -- cgit v1.2.3