def insert(self):
        """Insert buffer data at cursor(s)."""
        cur = self.get_cursor()
        buffer = list(self.get_buffer())

        # If we have more than one cursor
        # Or one cursor and one line
        if len(self.cursors) > 1 or len(buffer) == 1:
            # If the cursor count is more than the buffer length extend
            # the buffer until it's at least as long as the cursor count
            while len(buffer) < len(self.cursors):
                buffer.extend(buffer)
            curs = sorted(self.cursors, key=lambda c: (c[1], c[0]))
            for cursor in curs:
                line = self.lines[cursor.y]
                buf = buffer[0]
                line = line[:cursor.x] + buf + line[cursor.x:]
                self.lines[cursor.y].set_data(line)
                buffer.pop(0)
                self.move_x_cursors(cursor.y, cursor.x-1, len(buf))
        # If we have one cursor and multiple lines
        else:
            for buf in buffer:
                y = cur[1]
                if y < 0:
                    y = 0
                self.lines.insert(y, Line(buf))
                self.move_y_cursors(cur[1]-1, 1)
        self.move_cursors()
        self.scroll_down()
        # Add a restore point if previous action != insert
        self.store_action_state("insert")
dataset/ETHPy150Open richrd/suplemon/suplemon/editor.py/Editor.insert/original