Assertion failed: Write access is allowed inside write-action only

Error message: Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction())
java.lang.Throwable

at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:64)
at com.intellij.openapi.e.a.c.assertWriteAccessAllowed(c.java)
at com.intellij.openapi.editor.b.m.a(m.java:31)
at com.intellij.openapi.editor.b.m.replaceString(m.java:259)
...and more lines

This exception obtain always when I trying replace code from my plugin. I'm calling this code:

FileEditorManager.getInstance(myproject).getSelectedTextEditor().getDocument().replaceString(0, 0, mystring);

Text is replaced, but exception is generated.

In tracker I have found only this:

http://www.intellij.net/tracker/idea/viewSCR?publicId=32464

I don't know what it is. Can somebody help me?

-- likeapear


Please sign in to leave a comment.