Formatting gets lost when using CTRL + Z

Yes this is codemirror 5, I just used the latest source from GitHub. I also found another post here that had the same problem and fixed it by adding the historyKeymap but I have no idea how to do that. Already was looking in the codemirror manuals but found nothing so far.