'Move the viewport to focus the region of a command.
If the file of the command is not opened, then it will also open the
file.'

def _move_viewport(self, command):

    self._remove_highlight()
    file_name = command.file_name
    view = self.window.open_file(file_name)
    def move():
        view.sel().clear()
        view.sel().add(command.region)
        view.show(command.start)
        self._remove_highlight(view)
    run_after_loading(view, move)
