How to modify the document without publishing events?

I'm trying to write an idea plugin for remote pairing programming, and have some problems.

I created a socket server, the plugins on different idea can connect to it and send/get messages from it. When the content of an Idea editor is changed, it will publish a DocumentEvent to represent the change, then it will be sent to the server. The server will broadcast it to all the other Ideas, so they can know and apply the change.

But the problem is, the other editor will also publish such an document-change event after they applying the change. So it will never stop, the change is published and applied again and again...

Is there any way to modify the document without publishing events? Or is there any way to control it? Thanks!

1 comment
Comment actions Permalink

You cannot prevent Document from generating events on content changes. Instead, you should change your code, that sends notification over network, such that it ignores document changes initiated by your plugin.

0

Please sign in to leave a comment.