def region(self, header):

        try:
            index = self.headers.index(header)
        except ValueError:
            return

        start = header.start
        if index == len(self.headers) - 1:     # last header
            return (start, self._text_lenght)

        for next_h in self.headers[index + 1:]:
            if next_h.level <= header.level:
                return (start, next_h.start - 1)

        return (start, self._text_lenght)
compute() -> None
dataset/ETHPy150Open mgaitan/sublime-rst-completion/headers.py/RstHeaderTree.region--crossover with--dataset/ETHPy150Open VisTrails/VisTrails/vistrails/packages/vtk/vtkhandler.py/vtkInteractionHandler.compute