Also encountered this. Through a little bit of testing, I think this is persistent when you try to make a line break in the middle of a line without having any other lines below.
I also think that this bug only happens when typing at the end of the file.
Workaround is to make an empty line after the line you are typing, amd things go back to normal.