mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-05 23:51:29 +02:00
Fix the selection getting changed if the screen contents scroll while the selection is in progress
When the selection object was refactored to track the input co-ordinates, index_selection() was not updated accordingly. Fixes #3431
This commit is contained in:
@@ -108,6 +108,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Fix marking of text not working on lines that contain zero cells
|
||||
(:iss:`3403`)
|
||||
|
||||
- Fix the selection getting changed if the screen contents scroll while
|
||||
the selection is in progress (:iss:`3431`)
|
||||
|
||||
|
||||
0.19.3 [2020-12-19]
|
||||
-------------------
|
||||
|
||||
@@ -225,12 +225,20 @@ index_selection(const Screen *self, Selections *selections, bool up) {
|
||||
if (!is_selection_empty(s)) {
|
||||
if (up) {
|
||||
if (s->start.y == 0) s->start_scrolled_by += 1;
|
||||
else s->start.y--;
|
||||
else {
|
||||
s->start.y--;
|
||||
if (s->input_start.y) s->input_start.y--;
|
||||
if (s->input_current.y) s->input_current.y--;
|
||||
}
|
||||
if (s->end.y == 0) s->end_scrolled_by += 1;
|
||||
else s->end.y--;
|
||||
} else {
|
||||
if (s->start.y >= self->lines - 1) s->start_scrolled_by -= 1;
|
||||
else s->start.y++;
|
||||
else {
|
||||
s->start.y++;
|
||||
if (s->input_start.y < self->lines - 1) s->input_start.y++;
|
||||
if (s->input_current.y < self->lines - 1) s->input_current.y++;
|
||||
}
|
||||
if (s->end.y >= self->lines - 1) s->end_scrolled_by -= 1;
|
||||
else s->end.y++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user