From 0fc8b65a2b77a5c4dd066e4d49be470ee1d1f70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 24 Nov 2022 17:05:27 +0100 Subject: [PATCH] selection: selection_on_rows(): typo: row_start -> row_end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an issue where selections in the scroll margins were not detected correctly. This meant they weren’t canceled as they should have been, which in turn caused a visual glitch where text appeared to be selected, but were in fact not. --- CHANGELOG.md | 1 + csi.c | 4 ++-- selection.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5584b45..1f7d033b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,6 +102,7 @@ with a user-set line-height ([#1218][1218]). * Scaling factor not being correctly applied when converting pt-or-px config values (e.g. letter offsets, line height etc). +* Selection being stuck visually when `IL` and `DL`.` [1173]: https://codeberg.org/dnkl/foot/issues/1173 [1190]: https://codeberg.org/dnkl/foot/issues/1190 diff --git a/csi.c b/csi.c index 2eacaaa9..e77ae971 100644 --- a/csi.c +++ b/csi.c @@ -933,7 +933,7 @@ csi_dispatch(struct terminal *term, uint8_t final) break; } - case 'L': { + case 'L': { /* IL */ if (term->grid->cursor.point.row < term->scroll_region.start || term->grid->cursor.point.row >= term->scroll_region.end) break; @@ -953,7 +953,7 @@ csi_dispatch(struct terminal *term, uint8_t final) break; } - case 'M': { + case 'M': { /* DL */ if (term->grid->cursor.point.row < term->scroll_region.start || term->grid->cursor.point.row >= term->scroll_region.end) break; diff --git a/selection.c b/selection.c index 92f1f85f..f6349d7f 100644 --- a/selection.c +++ b/selection.c @@ -86,7 +86,7 @@ selection_on_rows(const struct terminal *term, int row_start, int row_end) const int rel_row_start = grid_row_abs_to_sb_precalc_sb_start(grid, sb_start, row_start); const int rel_row_end = - grid_row_abs_to_sb_precalc_sb_start(grid, sb_start, row_start); + grid_row_abs_to_sb_precalc_sb_start(grid, sb_start, row_end); int rel_sel_start = grid_row_abs_to_sb_precalc_sb_start(grid, sb_start, start->row); int rel_sel_end =