diff --git a/src/normal.cc b/src/normal.cc index 69fc9285..ebe86ebc 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -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: diff --git a/test/regression/0-no-incsearch/cmd b/test/regression/0-no-incsearch/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/0-no-incsearch/cmd @@ -0,0 +1 @@ + diff --git a/test/regression/0-no-incsearch/in b/test/regression/0-no-incsearch/in new file mode 100644 index 00000000..dd8fd25d --- /dev/null +++ b/test/regression/0-no-incsearch/in @@ -0,0 +1,3 @@ + +x1 +x2 diff --git a/test/regression/0-no-incsearch/kak_selection b/test/regression/0-no-incsearch/kak_selection new file mode 100644 index 00000000..9e35a1c8 --- /dev/null +++ b/test/regression/0-no-incsearch/kak_selection @@ -0,0 +1 @@ +x1 diff --git a/test/regression/0-no-incsearch/rc b/test/regression/0-no-incsearch/rc new file mode 100644 index 00000000..a8e8b092 --- /dev/null +++ b/test/regression/0-no-incsearch/rc @@ -0,0 +1 @@ +set-option global incsearch false diff --git a/test/regression/0-no-incsearch/script b/test/regression/0-no-incsearch/script new file mode 100644 index 00000000..2d5ea5a1 --- /dev/null +++ b/test/regression/0-no-incsearch/script @@ -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": [ "." ] }' +sleep 0.1 +ui_out -ignore 1