Adding non-persistent text.


Currently, I am adding text using document.insertString(startOffset, "insertion");
This same text can change when pressing the alt ] or [ keys.
The issue is that all these insertions are being saved in the user action history, and when using ctrl + z, all these actions are repeated.
How can I add text so that it is not stored in the user actions?



1 comment

Try adding

DocumentReference docRef = DocumentReferenceManager.getInstance().create(document);
UndoManager.getInstance(project).nonundoableActionPerformed(docRef, false);

Please sign in to leave a comment.