'Moves the screen page down through the history buffer.'

def next_page(self):

    if ((self.history.position < self.history.size) and self.history.bottom):
        mid = min(len(self.history.bottom), int(math.ceil((self.lines * self.history.ratio))))
        self.history.top.extend(self.buffer[:mid])
        self.history = self.history._replace(position=(self.history.position + self.lines))
        self.buffer[:] = (self.buffer[mid:] + [self.history.bottom.popleft() for _ in range(mid)])
        self.dirty = set(range(self.lines))
