aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-12-03 19:24:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-12-03 19:24:41 +0000
commit6cfb3216c350011ac7a15850f87e5dec6da29850 (patch)
tree6fe900100bca1f93c2ff23ca764aa785255ed271
parentrender: limit size of search surface to parent window (diff)
search: bug: restore end-col/end-row adjustment
Turns out end_col *can* be exactly 0. In this case, we need to adjust the end-row too.
-rw-r--r--search.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/search.c b/search.c
index 3609f81c..0000f606 100644
--- a/search.c
+++ b/search.c
@@ -123,8 +123,10 @@ search_update_selection(struct terminal *term,
term_damage_view(term);
/* Selection endpoint is inclusive */
- assert(end_col > 0);
- end_col--;
+ if (--end_col < 0) {
+ end_col = term->cols - 1;
+ end_row--;
+ }
/* Begin a new selection if the start coords changed */
if (start_row != term->search.match.row ||