From 61e88e44fc0f8ad8aa2ab2f69968d7a8ceaa8a77 Mon Sep 17 00:00:00 2001 From: CismonX Date: Wed, 28 Oct 2026 16:39:41 +0800 Subject: selection: fix multi-cell chars selection update As in 0e7e943062, absolute row numbers cannot be used for comparison. Here it may break selection update with multi-cell characters. Note that there's no need to compare the coordinates again. A better fix is to check the selection direction instead. --- selection.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'selection.c') diff --git a/selection.c b/selection.c index 261c4fb3..c17a9640 100644 --- a/selection.c +++ b/selection.c @@ -1286,9 +1286,7 @@ selection_update(struct terminal *term, int col, int row) * _into_ the multi-cell character. Again, because we do *not* * want the point to be inside the pad area. */ - if (new_start.row < new_end.row || - (new_start.row == new_end.row && new_start.col <= new_end.col)) - { + if (term->selection.direction != SELECTION_LEFT) { while (new_start.col >= 1 && row_start->cells[new_start.col].wc >= CELL_SPACER) new_start.col--; -- cgit v1.3