diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-04-17 17:16:47 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-04-17 17:16:47 +0000 |
| commit | c5519e2aa6aacc7b552bd4d629b21e00051c211a (patch) | |
| tree | f3909884f6845fc84712463537d2885802069e94 /search.c | |
| parent | wayland: refactor: remove ‘struct config’ pointer from wayland struct (diff) | |
search: fix next/prev not updating selection correctly when matches overlap
When the new match overlapped with the old match, the selection wasn’t
updated correctly.
Diffstat (limited to 'search.c')
| -rw-r--r-- | search.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -235,9 +235,15 @@ search_update_selection(struct terminal *term, const struct range *match) } #endif - /* Begin a new selection if the start coords changed */ + /* + * Begin a new selection if the start coords changed + * + * Note: check column against selection.coords, since our “old” + * start column isn’t reliable - we modify it when searching + * “next” or “prev”. + */ if (start_row != term->search.match.row || - start_col != term->search.match.col) + start_col != term->selection.coords.start.col) { int selection_row = start_row - grid->view + grid->num_rows; selection_row &= grid->num_rows - 1; |
