Not sure if this is your problem, but in Tools>Options>General, in the Large File Editing section there is a "Turn off undo when editing file larger than..." option.
You can also find a few other undo-related options opening Tools>Options and typing "undo" in the search field.