void (@NotNull Document document, @NotNull Runnable runnable) { document.putUserData(UndoConstants.DONT_RECORD_UNDO, Boolean.TRUE); try { runnable.run(); } finally { document.putUserData(UndoConstants.DONT_RECORD_UNDO, null); } }