My situation: I have a JTextPane with its own syntax highlighting. I have it set so that when the user stops typing, it updates the style in the text using the setCharacterAttributes() method.
My Issue: When these updates to the style are not performed, the undo manager works as expected. But when I do use it, the undo manager counts those style changes as actual undo-able actions! Meaning hitting Ctrl+z (I have it bound to undo when pressed) it just un-colors the last character i typed. Rather than actually removing/undoing it.
How would I get it so undo-ing and redo-ing only affects text changes and not style/font changes in my StyledDocument?
Thank you.