mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
This commit is contained in:
parent
24ee3dcc10
commit
c5519e2aa6
3 changed files with 11 additions and 3 deletions
10
search.c
10
search.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue