With incremental search, start empty and only repeat the previous search

if the user tries to search again with an empty prompt. This matches
emacs behaviour more closely.
This commit is contained in:
nicm
2021-01-08 08:22:10 +00:00
parent 199689954b
commit b96c5e3687
2 changed files with 35 additions and 15 deletions

View File

@ -2030,6 +2030,8 @@ window_copy_cmd_search_backward_incremental(struct window_copy_cmd_state *cs)
data->timeout = 0;
log_debug ("%s: %s", __func__, argument);
prefix = *argument++;
if (data->searchx == -1 || data->searchy == -1) {
data->searchx = data->cx;
@ -2083,6 +2085,8 @@ window_copy_cmd_search_forward_incremental(struct window_copy_cmd_state *cs)
data->timeout = 0;
log_debug ("%s: %s", __func__, argument);
prefix = *argument++;
if (data->searchx == -1 || data->searchy == -1) {
data->searchx = data->cx;