def get_hit_obj(self, pos: int) -> QBlockCodeObj:
        """
        Find the leaf node for a given character offset
        """
        if not self.hit_test(pos):
            return None
        for obj in self.subobjs:
            if not isinstance(obj, str):
                hit = obj.get_hit_obj(pos)
                if hit is not None:
                    return hit
        return self

        Find the leaf node for a given character offset
        
angrmanagement/ui/widgets/qblock_code.py