aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorEmily Vlasics <e.vlasics@mail.utoronto.ca>2026-07-29 03:11:15 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-07-30 05:17:14 +0000
commit5913184de4bfd945bec70333a752e02dac0b8500 (patch)
tree15fe536cdd4946642c30dac5bab58c229c20ddb4 /selection.c
parentchangelog: default URL regex updated (diff)
selection: fixed segfault when quote is on newline
Closes #2405
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/selection.c b/selection.c
index c58457d8..fb8c560a 100644
--- a/selection.c
+++ b/selection.c
@@ -597,9 +597,13 @@ selection_find_quote_right(struct terminal *term, struct coord *pos, char32_t qu
wc = row->cells[next_col].wc;
if (wc == quote_char) {
- pos->row = next_row;
- pos->col = next_col - 1;
- xassert(pos->col >= 0);
+ if (next_col == 0) {
+ pos->row = next_row - 1;
+ pos->col = term->cols - 1;
+ } else {
+ pos->row = next_row;
+ pos->col = next_col - 1;
+ }
return true;
}
}