From d518d9dafb218c308bd8e2be22b6c6bad6a4ac44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 27 Aug 2019 19:55:41 +0200 Subject: [PATCH] search: don't create a new selection when match start coords haven't changed --- search.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/search.c b/search.c index cdc7ccf5..03e114c0 100644 --- a/search.c +++ b/search.c @@ -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 */