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?

0

Hi,

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?

0

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. 

0

Hello JB team and Carol,

This question was asked multiple times and at each time, you answer something like "clarify ”. Even when the OP does, you don't answer then.
Please that post is quite recent, could you give specific references of the doc/listener/providers… to intercept undo operations.
Why we need that ? 
For dozen of reasons. Because first and overall, editor/caret listeners doesn't react to undo. For example, undo may move the caret but the listener on the caret will not be called by an undo. There is so many corner cases with undo and listener, so once for all can you please provide a real guideline rather than leaving the question without answer ? 

0

请先登录再写评论。