I see what you're saying, well sounds like your optimization skills needs work
This is what happens when you run i5, i7s at 3 GHz, you get sloppy
Anyway, you need to look at your representation of your data and use a more efficient method to search the text, also, you need to compute where highlighting is going ONCE on the fly, then update the data structure, for example.
This is a sentence "now everything in the quotes" should be blue!
But, if I change the sentence to :
This is a new sentence "now everything in the quotes" should be blue!
I only change a part of the sentence that has nothing to do with the quoted text, thus since I have ADDED any quotes, there is NO need to scan for quotes, all I need to do is update the position of the texthighlighting and NOT search the text, thus I need a linked list of pointers to the sections that are quoted, etc.
So, the point is to create dynamic data structures that give information and hints to what you need to do, so you don't have to scan every single keystroke and make updates --