def move_to_point(self, point):
        self.view.sel().clear()
        self.view.sel().add(sublime.Region(point))

        #if not self.view.visible_region().contains(point):
        pointrow, _ = self.view.rowcol(point)
        pointstart = self.view.text_point(max(pointrow - 3, 0), 0)
        pointend = self.view.text_point(pointrow + 3, 0)

        pointregion = sublime.Region(pointstart, pointend)

        if pointrow < 10:
            self.view.set_viewport_position((0.0, 0.0), False)
        elif not self.view.visible_region().contains(pointregion):
            self.view.show(pointregion, False)

        #sublime.set_timeout(partial(self.adjust_viewport, point), 0)

    # def adjust_viewport(self, point):
    #     _, view_begin = self.view.viewport_position()
    #     _, view_height = self.view.viewport_extent()
    #     view_end = view_begin + view_height

    #     _, point_begin = self.view.text_to_layout(point)
    #     point_end = point_begin + self.view.line_height()

    #     underflow = max(view_begin - point_begin, 0)
    #     overflow = max(point_end - view_end, 0)

    #     if overflow > 0:
    #         self.view.set_viewport_position((0.0, view_begin + overflow + 5), False)
    #     elif underflow > 0:
    #         self.view.set_viewport_position((0.0, view_begin - underflow - 5), False)
dataset/ETHPy150Open SublimeGit/SublimeGit/sgit/status.py/GitStatusMoveCmd.move_to_point/original