code: def index(self):
          
          top, bottom = self.margins or Margins(0, self.lines - 1)
          if self.cursor.y == bottom:
              # TODO: mark only the lines within margins?
              self.dirty.update(range(self.lines))
              for y in range(top, bottom):
                  self.buffer[y] = self.buffer[y + 1]
              self.buffer.pop(bottom, None)
          else:
              self.cursor_down()
docs: Move the cursor down one line in the same column. If the
          cursor is at the last line, create a new line at the bottom.