aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCismonX <admin@cismon.net>2026-05-23 22:47:49 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-06-12 15:36:42 +0000
commit382e9a31c5c631258da8f6ebb17f1b9aecb92e6b (patch)
treeef61050576f04180ab1a7d0fe0504dfb501256ee
parentterm: do not allow codepoint merging into grapheme clusters directly after a cursor move (diff)
selection: fix block selection direction update
This patch fixes a condition check in selection_update(), so that during block selection, the selection area no longer gets incorrectly updated when selecting back across the starting column.
-rw-r--r--CHANGELOG.md2
-rw-r--r--selection.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 803408af..04dfecc8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -92,6 +92,8 @@
* Require xkbcommon >= 1.6.0. This has been the case for a while, due
to our use of `XKB_KEYSYM_MAX`. Now it is formalized in
`meson.build` ([#2379][2379]).
+* Block selection area incorrectly updated when selecting back
+ across the starting column.
[2353]: https://codeberg.org/dnkl/foot/issues/2353
[2352]: https://codeberg.org/dnkl/foot/issues/2352
diff --git a/selection.c b/selection.c
index bb0d3f1b..4a62369d 100644
--- a/selection.c
+++ b/selection.c
@@ -1145,7 +1145,7 @@ selection_update(struct terminal *term, int col, int row)
struct coord *pivot_end = &term->selection.pivot.end;
if (term->selection.kind == SELECTION_BLOCK) {
- if (new_end.col > pivot_start->col)
+ if (new_end.col >= pivot_start->col)
new_direction = SELECTION_RIGHT;
else
new_direction = SELECTION_LEFT;