Hello everyone, I would like to set a property (=flag) via a button and thus a `command with repo`. This shall NOT be undone by the undo-action `ctrl + z`. Is this possible? If tried `UndoUtil.disabl...

This is an auto-generated question from the MPS Slack community: Hello everyone, I would like to set a property (=flag) via a button and thus a `command with repo`. This shall NOT be undone by the undo-action `ctrl + z`. Is this possible? If tried `UndoUtil.disableUndoFor()` like in a snippet I found online, but the undo-behaviour still works as always. I probably have the wrong argument (if it works at all) ```//inside a $swing component$-cell in the editor EditorFactory instance = EditorFactory.getInstance(); Document createDocument = ((EditorFactoryImpl) instance).createDocument(true); UndoUtil.disableUndoFor(createDocument);``` Does somebody have a working example or can give me a hint on how to get to the correct `Document`, that I can provide to the function?
3 comments
Comment actions Permalink
```Document doc = MPSUndoUtil.getDoc(node.model/.getRepository(), node.containingRoot/.getReference()); UndoUtil.disableUndoFor(doc);``` With this, I can still use undo as usually
0
Comment actions Permalink
```repository.getModelAccess().executeUndoTransparentCommand```
0
Comment actions Permalink
This is auto-generated question from the MPS Community Slack Workspace. If you want to comment on the question, do it from the Slack workspace
0

Post is closed for comments.