-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Atom changes open files when file simultaneously edited and saved in external applications that renames and replaces on save #17186
Description
Edit by @rsese
- Open some file in Atom
atom --safe file - Open the same file in Vim
- Edit and save the file in Vim
Expect the file to be updated in Atom with the changes from (3), actual is that the tab in Atom now shows file~ and has the content of the file before (3).
Reproduces on Windows 10 with Atom 1.26.1.
From #17186 (comment):
Simple way to recreate with a git-for-windows bash shell:
touch banana.txt
atom banana.txt
sleep 5 # Give atom time to open the file
# Simulate an external file save
mv banana.txt banana.txt.backup
touch banana.txt
Atom will end up with "banana.txt.backup" opened up, when the expected behavior is to have the new "banana.txt" either automatically loaded or for atom to warn that the file was modified.
Prerequisites
- [X ] Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
When a file (say test.tex) is simultaneously open in Atom and Scientific Workplace 5.5 (SW), and the file is edited and saved in SW, the window in Atom changes from test.tex to test.bak, instead of refreshing the content of test.tex.
Notice that the simultaneous editing and refreshing works correctly when using SW and WinEdt simultaneously, or when using WinEdt and Atom simultaneously. But not when using SW and Atom.
Steps to Reproduce
To reproduce, make sure that the "Create backup (.bak) Files" option is switched on in SW under Tools -> User Setup -> Files (this is the default choice).
-
Create a file test.tex in an empty directory, e.g., containing
\documentclass{article}
\begin{document}
Some text.
\end{document} -
Open the file using Atom. Left pane contains the content of the directory (only test.tex), right pane the content of the file.
-
Open the file using SW. Now the file is opened in both editors. SW created a temporary file test.aaa in the directory but we can ignore that one.
-
Edit the file in Atom and save. When moving focus back to SW, a dialog window in SW announces that the file has been overwritten and request reload. Click Yes. This is expected. The file on the hard drive is correctly modified.
-
Now edit the file in SW and save. SW correctly saves the file and creates a backup (.bak) file with the previous content. This is expected. HOWEVER, at the same time, the file test.tex opened in Atom automatically changes to test.bak (the caption in the header of the window changes), and its contents indeed correspond to the test.bak file created by SW, This is incorrect behavior.
Expected behavior: When the file test.tex is edited and saved in SW, Atom should refresh the opened file.
Actual behavior: The opened file in Atom changes from test.tex to test.bak.
Reproduces how often: Always.
Versions
Same behavior in Atom 1.24.0 and Atom 1.26.0, both clean installations, with no extra packages and including in safe mode.
Windows 10, Scientific Workplace 5.5
Atom : 1.24.0
Electron: 1.6.16
Chrome : 56.0.2924.87
Node : 7.4.0
Atom : 1.26.0
Electron: 1.7.11
Chrome : 58.0.3029.110
Node : 7.9.0
Additional Information
N/A