def cut(self):
        """Cut lines to buffer."""
        # Store cut lines in buffer
        cut_buffer = []
        # Get all lines with cursors on them
        line_nums = self.get_lines_with_cursors()
        # Sort from last to first (invert order)
        line_nums = line_nums[::-1]
        i = 0
        while i < len(line_nums):  # Iterate from last to first
            # Make sure we don't completely remove the last line
            if len(self.lines) == 1:
                cut_buffer.append(self.lines[0])
                self.lines[0] = Line()
                break
            # Get the current line
            line_no = line_nums[i]
            # Get and remove the line
            line = self.lines.pop(line_no)
            # Put it in our temporary buffer
            cut_buffer.append(line)
            # Move all cursors below the current line up
            self.move_y_cursors(line_no, -1)
            i += 1
        self.move_cursors()  # Make sure cursors are in valid places
        # Reverse the buffer to get correct order and store it
        self.set_buffer(cut_buffer[::-1])
        self.store_action_state("cut")
dataset/ETHPy150Open richrd/suplemon/suplemon/editor.py/Editor.cut/original