Reset scroll when toggling screen buffers

This commit is contained in:
Kovid Goyal 2016-12-02 14:35:38 +05:30
parent 5a068f7578
commit 7afbfb8349
2 changed files with 5 additions and 0 deletions

View File

@ -331,6 +331,8 @@ void screen_toggle_screen_buffer(Screen *self) {
self->linebuf = self->main_linebuf;
self->tabstops = self->main_tabstops;
}
PyObject_CallMethod(self->callbacks, "buf_toggled", "O", self->linebuf == self->main_linebuf ? Py_True : Py_False);
if (PyErr_Occurred()) { PyErr_Print(); PyErr_Clear(); }
screen_restore_cursor(self);
tracker_update_screen(self->change_tracker);
}

View File

@ -227,6 +227,9 @@ class Window:
k = key_map[GLFW_KEY_UP if upwards else GLFW_KEY_DOWN]
self.write_to_child(k * abs(s))
def buf_toggled(self, is_main_linebuf):
self.char_grid.scroll('full', False)
# actions {{{
def paste(self, text):