def index(self):
        margins = self.margins

        # When scrolling over the full screen height -> keep history.
        if margins is None:
            # Simply move the cursor one position down.
            cursor_position = self.pt_cursor_position
            cursor_position.y += 1
            self.max_y = max(self.max_y, cursor_position.y)

            # Cleanup the history, but only every 100 calls.
            self._history_cleanup_counter += 1
            if self._history_cleanup_counter == 100:
                self._remove_old_lines_from_history()
                self._history_cleanup_counter = 0
        else:
            # Move cursor down, but scroll in the scrolling region.
            top, bottom = self.margins
            line_offset = self.line_offset

            if self.pt_cursor_position.y - line_offset == bottom:
                data_buffer = self.data_buffer

                for line in range(top, bottom):
                    data_buffer[line + line_offset] = \
                        data_buffer[line + line_offset + 1]
                    data_buffer.pop(line + line_offset + 1, None)
            else:
                self.cursor_down()
Add a reader to this stream.  There can only be one reader
dataset/ETHPy150Open jonathanslenders/pymux/pymux/screen.py/BetterScreen.index--crossover with--dataset/ETHPy150Open HenryHu/pybbs/xmpp/readstream.py/ReadStream.read