No idea why this happens but sometimes when it happens, every key I type is repeated. Backspade/Delete also delete two characters.
When closing the document and reopening it, I get "Specified argument was out of the range of valid values. Parameter name: length". Only a visual studio restart fixes it until it happens again.