Search code examples
android-studiointellij-ideaintellij-plugin

How do I detect Intellij or Android stdio file modifications 'real' realtime?


I am writing a plugin for intellij idea.

How do I detect Intellij or Android stdio file modifications realtime?

Solution 1:BulkFileListener

But it works after pressing Ctrl+S. When a character was added or deleted without ctrl+s, it cannot report this event.

Solution 2: TypedActionHandler

But it only works for adding characters. When a character or a line was deleted, it cannot report this event.

The above two are not what I want.

Any other advices?


Solution

  • To get notifications about changes in all documents, you can use EditorFactory.getEventMulticaster().addDocumentListener().