Thanks I have implemented and test the lexer and editor in the way you suggested and made several tests and I have not been able to trigger any error so far.
However, it would have been nice if I could just temporarily disable the timer while changing text.