use plain SelectionList for regex_prompt

This commit is contained in:
Maxime Coste 2014-05-14 00:27:41 +01:00
parent 11d9b60766
commit fbf7856e3e

View File

@ -599,13 +599,14 @@ void paste(Context& context, int)
template<typename T> template<typename T>
void regex_prompt(Context& context, const String prompt, T func) void regex_prompt(Context& context, const String prompt, T func)
{ {
DynamicSelectionList selections{context.selections()}; SelectionList selections = context.selections();
context.input_handler().prompt(prompt, "", get_color("Prompt"), complete_nothing, context.input_handler().prompt(prompt, "", get_color("Prompt"), complete_nothing,
[=](const String& str, PromptEvent event, Context& context) { [=](const String& str, PromptEvent event, Context& context) mutable {
try try
{ {
if (event != PromptEvent::Change and context.has_ui()) if (event != PromptEvent::Change and context.has_ui())
context.ui().info_hide(); context.ui().info_hide();
selections.update();
context.selections() = selections; context.selections() = selections;
context.input_handler().set_prompt_colors(get_color("Prompt")); context.input_handler().set_prompt_colors(get_color("Prompt"));
if (event == PromptEvent::Abort) if (event == PromptEvent::Abort)