void () { final Document doc = editor.getDocument(); doc.startGuardedBlockChecking(); try { executeWriteAction(editor, caret, dataContext); } catch (ReadOnlyFragmentModificationException e) { EditorActionManager.getInstance().getReadonlyFragmentModificationHandler(doc).handle(e); } finally { doc.stopGuardedBlockChecking(); } }