def line(self, x): if isinstance(x, Region): return sublime_api.view_line_from_region(self.view_id, x) else: return sublime_api.view_line_from_point(self.view_id, x)