aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCismonX <admin@cismon.net>2026-10-28 08:39:41 +0000
committerCismonX <admin@cismon.net>2026-10-28 08:39:41 +0000
commit61e88e44fc0f8ad8aa2ab2f69968d7a8ceaa8a77 (patch)
tree27a860d7dc6ee79aefa10f2f8cdb6391aeb325af
parentwayland: update_terms_on_monitor(): skip terminals in the process of shutting down (diff)
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.
-rw-r--r--selection.c4
1 files changed, 1 insertions, 3 deletions
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--;