How can I track *all* changes in the active editor while typing/refactoring/etc?

Hello,

   I want to track all changes, what are happening in the active editor. How can I register a listener on that? So far I have tried two things:

1) creating a new EditorAction (but this requires me to provide a shortcut to work.. or, there is a way to activate action for every keystroke?)
2) I've used VirtualFileManager.getInstance().addVirtualFileListener(), thou it looks too low level for me. I would like to have Document at my hand, not just VirtualFile.

Is there a more correct way of doing that?

Wbr,
Jevgeni

3 comments
Comment actions Permalink

Hi Jevgeni,

You can use com.intellij.openapi.editor.event.EditorEventMulticaster.addDocumentListener() for that

Denis

0
Comment actions Permalink

Denis, thank you! That is exactly what I was looking for

:)
0
Comment actions Permalink

My pleasure :)

Denis

0

Please sign in to leave a comment.