Bug: Custom.ts would sometimes change the main.ts code into the custom.ts

I do not know how to replicate, but it just did that and I lost my project. I was about to save it, but I could not in time.