From 07b70f8c95481c9fbb67805a0f48de2736f889e7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 29 Nov 2017 18:12:22 +0530 Subject: [PATCH] Image display: Fix displaying images taller than two screen heights not scrolling properly Fixes #194 --- CHANGELOG.rst | 3 +++ kitty/screen.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3383144b3..da6cad254 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,9 @@ version 0.6.0 [future] - Fix shift+up/down not rendering correct escape codes +- Image display: Fix displaying images taller than two screen heights not + scrolling properly + version 0.5.0 [2017-11-19] --------------------------- diff --git a/kitty/screen.c b/kitty/screen.c index be0d336b5..1e11242e1 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -436,7 +436,8 @@ screen_handle_graphics_command(Screen *self, const GraphicsCommand *cmd, const u if (response != NULL) write_to_child(self, response, strlen(response)); if (x != self->cursor->x || y != self->cursor->y) { if (self->cursor->x >= self->columns) { self->cursor->x = 0; self->cursor->y++; } - if (self->cursor->y > self->margin_bottom) { screen_scroll(self, self->cursor->y - self->margin_bottom); } + if (self->cursor->y > self->margin_bottom) screen_scroll(self, self->cursor->y - self->margin_bottom); + screen_ensure_bounds(self, false); } } // }}} @@ -701,7 +702,6 @@ screen_index(Screen *self) { void screen_scroll(Screen *self, unsigned int count) { // Scroll the screen up by count lines, not moving the cursor - count = MIN(self->lines, count); unsigned int top = self->margin_top, bottom = self->margin_bottom; while (count > 0) { count--;