summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKovid Goyal <kovid@kovidgoyal.net>2018-09-12 20:31:09 +0530
committerKovid Goyal <kovid@kovidgoyal.net>2018-09-12 20:31:09 +0530
commitf0ff2f4ea7e77a5706331286203b5b659046534a (patch)
treecd493e3d40b42697937860411d88fb73c0be100f
parentd583c533c2bc32b44dd940e0251117ce167cc19e (diff)
Fix a bug causing incorrect line ordering when viewing the scrollback buffer if the scrollback buffer is full
Fixes #960
-rw-r--r--docs/changelog.rst3
-rw-r--r--kitty/history.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index c98ebe2e..59bee1d7 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -30,6 +30,9 @@ Changelog
hopefully workaround a bug in glfw that causes crashes when unplugging
monitors with full screen windows. (:iss:`898`)
+- Fix a bug causing incorrect line ordering when viewing the scrollback buffer
+ if the scrollback buffer is full (:iss:`960`)
+
- Fix drag-scrolling not working when the mouse leaves the window confines
(:iss:`917`)
diff --git a/kitty/history.c b/kitty/history.c
index 09c7c0d6..b8d80bfd 100644
--- a/kitty/history.c
+++ b/kitty/history.c
@@ -207,7 +207,7 @@ as_ansi(HistoryBuf *self, PyObject *callback) {
}
static inline Line*
-get_line(HistoryBuf *self, index_type y, Line *l) { init_line(self, y, l); return l; }
+get_line(HistoryBuf *self, index_type y, Line *l) { init_line(self, index_of(self, self->count - y - 1), l); return l; }
static PyObject*
as_text(HistoryBuf *self, PyObject *args) {