import javax.swing.undo.UndoManager; svoid clearTextComponentUndoList(JTextComponent c) swing { printVars clearTextComponentUndoList(l := l(getText(c)), +c); ifclass RSyntaxTextArea if (c cast RSyntaxTextArea) ret with c.discardAllEdits(); endif UndoManager undo = cast metaGet(c, "UndoManager"); if (undo != null) undo.discardAllEdits(); }