def run_ex_command(self, edit, command_line=''):
        assert command_line, 'expected non-empty command line'

        move_command = parse_command_line(command_line)

        if move_command.command.address is None:
            show_error(VimError(ERR_INVALID_ADDRESS))
            return

        source = move_command.line_range.resolve(self.view)

        if any(s.contains(source) for s in self.view.sel()):
            show_error(VimError(ERR_CANT_MOVE_LINES_ONTO_THEMSELVES))
            return

        destination = move_command.command.address.resolve(self.view)

        if destination == source:
            return

        text = self.view.substr(source)
        if destination.end() >= self.view.size():
            text = '\n' + text.rstrip()

        if destination == R(-1):
            destination = R(0)

        if destination.end() < source.begin():
            self.view.erase(edit, source)
            self.view.insert(edit, destination.end(), text)
            self.set_next_sel([[destination.a, destination.b]])
            return

        self.view.insert(edit, destination.end(), text)
        self.view.erase(edit, source)
        self.set_next_sel([[destination.a, destination.a]])
dataset/ETHPy150Open guillermooo/Vintageous/ex_commands.py/ExMove.run_ex_command/original