def start_of_function_def(editor, start_line):
    """ Find where a function starts, beginning with `start_line` and working backward """
    for i in reversed(range(start_line + 1)):
        if editor.lines[i].lstrip().startswith("def "):
            return i
    return None