Fix spurious incremental search when incsearch=false

Regressed in a2c41593a (Fix partial regex text being pushed in history,
2023-11-02).
This commit is contained in:
Johannes Altmanninger 2023-11-11 12:32:18 +01:00
parent 6babba9bfa
commit c597a056d0
6 changed files with 15 additions and 1 deletions

View File

@ -860,7 +860,9 @@ void regex_prompt(Context& context, String prompt, char reg, T func)
{
case PromptEvent::Abort: return;
case PromptEvent::Change:
if (incsearch and not str.empty())
if (not incsearch)
return;
if (not str.empty())
RegisterManager::instance()[reg].set(context, str.str());
break;
case PromptEvent::Validate:

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,3 @@
x1
x2

View File

@ -0,0 +1 @@
x1

View File

@ -0,0 +1 @@
set-option global incsearch false

View File

@ -0,0 +1,6 @@
ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "/x" ] }'
sleep 0.1
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ".<ret>" ] }'
sleep 0.1
ui_out -ignore 1