cannot save R script

I'm not super new to R and Rstudio but this is the first time I met this problem.
There is no error message returned when I tried to save file ABC.R, everything works fine here, the red file name at top , which indicates there are unsaved changes, turns black, and I believe the file is saved. But after I closed the file then reopened it, everything I wrote disappear.
Then I create a new file XYZ.R, type something randomly into it, save it, close and reopen it, everything looks fine.
At last, I recovered what I wrote for the file ABC.R, paste the codes into a new R file, save it, close and reopen it, another empty file.
I dont understand what is going on here. Is there some cencsorship that will prevent you save illegal codes? Rstudio version is 1.2.1335
EDIT: Now I'm getting even more confused, I tried to create a .txt file, paste my ABC.R file content into it, everything works fine. Then I rename this ABC.txt to ABC.R, open it in Rstudio, empty file again, but the file exploerer told me its size is 1kb so not an empty file, then I reopen this ABC.R file using text editor, and everything I wrote was there. Then I reopen this ABC.R file in rstudio, again paste my code into it, save it. This time after I close the file, its size turn to 0kb and reopen it by text editor also returns an empty file.