diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-08-27 17:55:41 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-08-27 17:55:41 +0000 |
| commit | d518d9dafb218c308bd8e2be22b6c6bad6a4ac44 (patch) | |
| tree | 5ecd94c15d55906932e71e7919c4a6017e143ae0 | |
| parent | input: cancel search on mouse button events (diff) | |
search: don't create a new selection when match start coords haven't changed
| -rw-r--r-- | search.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 */ |
