search: don't create a new selection when match start coords haven't changed

This commit is contained in:
Daniel Eklöf 2019-08-27 19:55:41 +02:00
parent 3f767be500
commit d518d9dafb
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -153,8 +153,14 @@ search_update(struct terminal *term)
start_row--;
}
/* Begin a selection (it's finalized when "committing" the search) */
selection_start(term, start_col, start_row - term->grid->view);
/* Begin a new selection if the start coords changed */
if (start_row != term->search.match.row ||
start_col != term->search.match.col)
{
selection_start(term, start_col, start_row - term->grid->view);
}
/* Update selection endpoint */
selection_update(term, end_col, end_row - term->grid->view);
/* Update match state */