If you reset m_lastText and m_lastUtf8Text in Update()/UpdateW() respectively (via .clear()) everything should work.