From 38b3424a1148779a659ea26077965518118c8e9f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 30 Jul 2026 07:29:50 +0200 Subject: selection: find-quote-right: assert next-row > 0 --- selection.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selection.c b/selection.c index fb8c560a..818a6834 100644 --- a/selection.c +++ b/selection.c @@ -598,6 +598,10 @@ selection_find_quote_right(struct terminal *term, struct coord *pos, char32_t qu wc = row->cells[next_col].wc; if (wc == quote_char) { if (next_col == 0) { + /* Selection coordinates are view-relative, and it + isn't possible to have a right-side quote with + next-col == 0 AND next_row == 0 */ + xassert(next_row > 0); pos->row = next_row - 1; pos->col = term->cols - 1; } else { -- cgit v1.3