def run_cmd(self, util, move_cmd, **kwargs):
        view = self.view
        selection = view.sel()

        # peek at the count
        count = util.get_count(True)
        if 'direction' in kwargs:
            count *= kwargs['direction']

        # remember the current cursor positions
        orig_cursors = [s for s in selection]
        view.run_command(move_cmd, kwargs)

        # extend each cursor so we can delete the bytes, and only if there is only one region will
        # we add the data to the kill ring
        new_cursors = [s for s in selection]

        selection.clear()
        for old,new in zip(orig_cursors, new_cursors):
            if old < new:
                selection.add(sublime.Region(old.begin(), new.end()))
            else:
                selection.add(sublime.Region(new.begin(), old.end()))

        # check to see if any regions will overlap each other after we perform the kill
        cursors = list(selection)
        regions_overlap = False
        for i, c in enumerate(cursors[1:]):
            if cursors[i].contains(c.begin()):
                regions_overlap = True
                break

        if regions_overlap:
            # restore everything to previous state
            selection.clear()
            selection.add_all(orig_cursors)
            return

        # copy the text into the kill ring
        regions = [view.substr(r) for r in view.sel()]
        kill_ring.add(regions, forward=count > 0, join=util.state.last_was_kill_cmd())

        # erase the regions
        for region in selection:
            view.erase(util.edit, region)
dataset/ETHPy150Open grundprinzip/sublemacspro/jove.py/SbpMoveThenDeleteCommand.run_cmd/original