I'm showing a Document in a EditorTextField on a dialog.
In the initialization code, I'm performing some string manipulations on the
Document (using RangeMarkers makes this easy).
IDEA insists that I perform any mutations on the Document inside a runWriteAction()+executeCommand().
1) Is it possible to use a Document in a "background" (non-UI) fashion, without
all the runWriteAction()+executeCommand() nesting? I'd like to use RangeMarkers
etc, but without any UI.
2) If I perform the mutations inside runWriteAction()+executeCommand(), they're
pushed on the undo stack. How do I get the editor that's showing my Document
to start with an empty undo stack?