def METHOD_NAME(self, generator: Any, end_location: str) -> bool:
    # below code buggy for markdown
    if isinstance(self._lexer, MarkdownLexer):
        return False
    # Only for subclasses of RegexLexer that don't override get_tokens_unprocessed
    # TODO: support ExtendedRegexLexer's context thing
    if type(self._lexer).get_tokens_unprocessed == RegexLexer.get_tokens_unprocessed:
        # Use local variables inside the generator (ugly hack)
        local_vars = generator.gi_frame.f_locals
        # If new_state variable is not None, it will be used to change
        # state after the yielding, and this is not a suitable place for
        # restarting the highlighting later.
        return (
            local_vars["statestack"] == ["root"] and local_vars.get("new_state", None) is None
        )
    # Start of line (column zero) and not indentation or blank line
    return end_location.endswith(".0") and bool(self.textwidget.get(end_location).strip())