Fix selection not updating properly while scrolling

Fixes #2442
This commit is contained in:
Kovid Goyal 2020-03-18 18:48:59 +05:30
parent a06fdad034
commit 3bff3bcbe4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 5 additions and 1 deletions

View File

@ -69,6 +69,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Fix colors in scrollback pager off if the window has redefined terminal
colors using escape codes (:iss:`2381`)
- Fix selection not updating properly while scrolling (:iss:`2442`)
- Workaround for bug in less that causes colors to reset at wrapped lines
(:iss:`2381`)

View File

@ -2188,6 +2188,7 @@ scroll(Screen *self, PyObject *args) {
bool
screen_is_selection_dirty(Screen *self) {
IterationData q;
if (self->scrolled_by != self->last_rendered.scrolled_by) return true;
iteration_data(self, &self->selection, &q, 0, true);
if (memcmp(&q, &self->last_rendered.selection, sizeof(IterationData)) != 0) return true;
iteration_data(self, &self->url_range, &q, 0, true);

View File

@ -85,7 +85,7 @@ typedef struct {
Selection selection, url_range;
struct {
IterationData selection, url;
unsigned int cursor_x, cursor_y;
unsigned int cursor_x, cursor_y, scrolled_by;
} last_rendered;
bool use_latin1, is_dirty, scroll_changed, reload_all_gpu_data;
Cursor *cursor;

View File

@ -344,6 +344,7 @@ cell_prepare_to_render(ssize_t vao_idx, ssize_t gvao_idx, Screen *screen, GLfloa
send_graphics_data_to_gpu(screen->grman->count, gvao_idx, screen->grman->render_data);
changed = true;
}
screen->last_rendered.scrolled_by = screen->scrolled_by;
return changed;
}