Avoid restoring selections in regex_prompt when they cannot have been modified
This commit is contained in:
parent
3e9fcf828f
commit
a45876124b
|
@ -563,16 +563,20 @@ void regex_prompt(Context& context, const String prompt, T func)
|
||||||
{
|
{
|
||||||
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_write_only() = selections;
|
|
||||||
if (context.has_window())
|
|
||||||
context.window().set_position(position);
|
|
||||||
|
|
||||||
context.input_handler().set_prompt_face(get_face("Prompt"));
|
const bool incsearch = context.options()["incsearch"].get<bool>();
|
||||||
if (event == PromptEvent::Abort)
|
if (incsearch)
|
||||||
return;
|
{
|
||||||
if (event == PromptEvent::Change and
|
selections.update();
|
||||||
(str.empty() or not context.options()["incsearch"].get<bool>()))
|
context.selections_write_only() = selections;
|
||||||
|
if (context.has_window())
|
||||||
|
context.window().set_position(position);
|
||||||
|
|
||||||
|
context.input_handler().set_prompt_face(get_face("Prompt"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event == PromptEvent::Abort or
|
||||||
|
(event == PromptEvent::Change and (not incsearch or str.empty())))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event == PromptEvent::Validate)
|
if (event == PromptEvent::Validate)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user