void () { ApplicationManager.getApplication().runWriteAction(new Runnable() { public void run() { Document doc = getEditor(source).getDocument(); doc.startGuardedBlockChecking(); try { doc.deleteString(myDraggedRange.getStartOffset(), myDraggedRange.getEndOffset()); } catch (ReadOnlyFragmentModificationException e) { EditorActionManager.getInstance().getReadonlyFragmentModificationHandler().handle(e); } finally { doc.stopGuardedBlockChecking(); } } }); }