def index(from: nil, to: nil, &block)
      each_with_depth(from: from, to: to) do |line, depth, index|
        return index if block.call(line, depth, index)
      end
    end
def index(from: nil, to: nil, &block)
      each_with_depth(from: from, to: to) do |line, depth, index|
        return index if block.call(line, depth, index)
      end
    end
Returns the index of the first line where the passed block returns true