Is there any way to remove actions from the undo buffer?
I have created a basic RichTextBox syntax highlighter. As you type it will search for key words within the line you are currently editing. When a key word is found it will select that word then apply a color to it.
Here is what I mean: I type the words "float boat". The word "float" is a key word and will be selected then it's color changed... "boat" is not a key word and will be left alone. This is the input sequence:
f, l, o, a, t, selection of float, space, b, o, a, t
So, when you undo the typing of the two words all is well until you try to undo the typing of the "t" in float. You have to press undo twice, once to undo the selection of float and once to undo the "t".
All I want to have in the undo buffer is:
f, l, o, a, t, space, b, o, a, t
but not the selection of the word.
Any ideas will be greatly appreciated!