I had the same issue with my laptop, when i was having the issue i tried running a malware scan, reinstall my OS, even tried different OS but still the same issue occur. Normally if you are having that issue when you open a text file it will automatically delete the content of it.
So, basically its a keyboard issue, somehow the delete button is stuck.