PyCharm removes the code accidentally
I am using PyCharm 2021.3 (Professional Edition)
Build #PY-213.5744.248, built on November 30, 2021
Accidentally, PyCharm does not save the code, not only this, it deletes the file content :\
see attached video
Upload id: 2021_12_22_5G8PB4GKAPZtzst9 (file: video1.mp4)
I can't understand what is going on xD
请先登录再写评论。
Are there any custom plugins installed?
Does File | Save All help in preventing the issue?
I found the case. It's because auto upload to remote host is enabled.
I disabled the auto upload then the problem gone.
I can't imagine how auto upload could cause this. Is this a locally stored file on a video? No symlinks, mapped folders or similar? Do you have any other background sync services running against this project?
I use Vagrant machine. This machine syncs a local folder, ex: /home/user/sync_folder:/var/www.
Any change happens in local file will reflect on Vagrant machine synced folder.
With IDE auto-upload option enabled, there will be a conflict between syncing process and auto upload operation.
IDE writes into temporary files before saving them, that might be causing the problem. Try disabling "Back up files before saving" checkbox at File | Settings (Preferences on macOS) | Appearance & Behavior | System Settings.
Also, if you're syncing files with a vagrant machine - there's no need to upload the files to said vagrant machine?
If vagrant auto sync is enabled, no need to auto-upload the changes to the vagrant machine by IDE.
Yea, that's the point: you can just disable auto-upload since vagrant background files system sync interferes with IDE file saving mechanisms.