def run_cmd(self, util, direction):
        view = self.view
        state = util.state
        regions = util.get_regions()
        if not regions:
            regions = util.get_cursors()
        if regions:
            util.save_cursors("shift")
            util.toggle_active_mark_mode(False)
            selection = self.view.sel()
            selection.clear()

            # figure out how far we're moving
            if state.argument_supplied:
                cols = direction * util.get_count()
            else:
                cols = direction * util.get_tab_size()

            # now we know which way and how far we're shifting, create a cursor for each line we
            # want to shift
            amount = abs(cols)
            count = 0
            shifted = 0
            for region in regions:
                for line in util.for_each_line(region):
                    count += 1
                    if cols < 0 and (line.size() < amount or not util.is_blank(line.a, line.a + amount)):
                        continue
                    selection.add(sublime.Region(line.a, line.a))
                    shifted += 1

            # shift the region
            if cols > 0:
                # shift right
                self.view.run_command("insert", {"characters": " " * cols})
            else:
                for i in range(amount):
                    self.view.run_command("right_delete")

            # restore the region
            util.restore_cursors("shift")
            sublime.set_timeout(lambda: util.set_status("Shifted %d of %d lines in the region" % (shifted, count)), 100)

# Enum definition
dataset/ETHPy150Open grundprinzip/sublemacspro/jove.py/SbpShiftRegionCommand.run_cmd/original