Adding non-persistent text.

Answered

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
1 comment

Try adding

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

Please sign in to leave a comment.