aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'search.c')
-rw-r--r--search.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/search.c b/search.c
index 2a7903d7..0ae09fde 100644
--- a/search.c
+++ b/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;