Fix crash pressing super/subscript buttons when equation has trailing whitespace