diff --git a/src/command_manager.cc b/src/command_manager.cc index 26b2379f..6e61d55d 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -545,6 +545,13 @@ Completions CommandManager::complete(const Context& context, cursor_pos_in_token); completions.start += start; completions.end += start; + + for (auto& candidate : completions.candidates) + { + if (candidate.find_first_of(" \t;\"'") != String::npos) + candidate = '"' + escape(candidate, '"', '\\') + '"'; + } + return completions; } default: