Highlighting logic is not executed correctly when after an invalid expression, another invalid expression is entered.