Excluding steps from the undo history

Hi! Is it possible to exclude certain actions from the undo history? For example, if you to move some nodes with python, but don’t want the undo manager to record it. I see there’s beginUndo() / endUndo() and beginChanges() / endChanges(), but it’s sort of the opposite.

I don’t know think there is a straightforward way of disabling undo history for the glyphs of a font.

What would be your use case? Glyphs that are not part of a font do not record any history, if that is sufficient for your use case.

I think for that you can use the Fast() method, if I’m not wrong.
Like GSNode.setPositionFast_() for example

Thank you! For custom components (but I occasionally want it elsewhere too). Hmm, is that why caps/segment components are hints rather than paths, so that they get added to the layer as paths just on export?

Thanks Hugo, I’ll check if that works, it would be great!

There are some method alternatives ending in …Fast. They typically skip undo history, but some of those methods also skip other validation and need to be used with great care.

1 Like

Why do you need that?

You can do layer.undoManager().disableUndoRegistration() / layer.undoManager().enableUndoRegistration().
But be careful with that. If you invoke undo afterwards, Glyphs might crash.