How to modify undo behaviours?


I am coding a plugin and want to modify if control + z is pressed by the user. How to implement this?



Please always clarify your use case. Why do you need it? What is the feature you are trying to implement? Do you want to replace the undo action with your custom one? If yes, in what context?


Hello, sorry my question wasn't clear. I add some inlays in the editor when the user types something and want to clear them if the user undoes it. I am already clearing them if caretPositionChanged is called and i think maybe in earlier versions of intellij, undo wasn't calling caretPositionChanged but I checked in the latest version, they were being cleared by undo through caretPositionChanged so my problem is solved as of now. There is no EditorAction for undo. I might have to separately handle undo if it happens again, so I would still like to know. 


Please sign in to leave a comment.