You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Atom doesn't update file buffers correctly when switching branches. #4982
Open an existing file and modify it. Keep it open.
git commit -am "Modifying file"
git checkout master
At this point you'd expect to see that the edits which you made would be gone since you are now viewing a different branch. However, the edits show up and git diff even highlights them.
Also PR #1271 supposedly fixed #693 (Closing file buffers when a file gets removed via git i.e. switching branches, deleting, etc.) but that is not happening for me. When I switch branches and a file gets removed, it stays open in Atom with no indication that it's not supposed to be there.
Edit: Personally I think a file getting removed via git should automatically close the buffer, while a file getting removed in another way should prompt you. "This file no longer exists, do you want to keep it open?". This is how Notepad++ handles the situation and I think that is the best way.
Reacted by Gudjon, doomstrike, Sergey Gnuskov, Benoit Essiambre, Ash Kamel, Laura Kishimoto, Kyle Odell, Dan Caron, Pierpaolo Pantone, Ryan Leahy and 16 more
@lee-dohm Using atom --safe fixed the issue temporarily. After step 6 I switched back and forth between new_feature and master a few more times and the issue occurred after switching for the 5th time. I'm running Windows 7 with Atom v 0.169.0
We need whatever information can help us reproduce it, at which point we could consider it a bug. I am sadly not able to reproduce this issue
Personally I think a file getting removed via git should automatically close the buffer, while a file getting removed in another way should prompt you.
This does happen for me. Steps for this: a file on master but not on your branch, and you switch from master to the branch, it should close.
I experienced a similar issue. Am using Atom 1.0 on OpenSuse 13.2 and when i switched to a different branch. The old files which I created on the other branch were still there. When I tried to close them . It asked if i should save the changes. I also think they should just disappear from the buffer.
I'm having the same problem on Fedora 20 using Atom 1.0. When switching branches I have to manually close windows and select don't save for each file that doesn't exist on the newly switched branch. I think the files should just disappear from the buffer also.
Just thought I would say that I've only ever experienced this when switching branches from a tool other than the command line i.e. sourceTree atom 1.0.7 OSX 10.10.5 git 2.3.2
if I switch from terminal or iterm then everything works as expected
Solution by @ungb is pretty good, but kind of unfortunate that there's not more direct git integration here. E.g.: it'd be nice if this happened when the git branch switches, but not for general deletions otherwise (this way atom would save the buffer if it was accidentally deleted by some other mechanism).
On 1.23.3 I am still having these issues even with the solution by @ungb. Files do not update after changing branch. Not even restarting has worked so I am forced to use another text editor.
Reacted by Dainius Stankevicius, Zach Broniszewski and samablews
I was not having this problem up until a couple days ago. I'm running Ubuntu 16.04.3 LTS, atom 1.2.3 downloaded by adding the repo to my system. If I completely wipe my disk, reinstall Ubuntu, install atom, and test switching branches, it will work. When I restart my computer, it stops working. In the bottom pane of atom where it tells you the branch you are on, that only changes the branch name once you give focus to atom after running for example "git checkout newBranch" in terminal. So to summarize, if I checkout a new branch, nothing will happen. When I click into atom, it will change the branch, the git diff package will highlight changed lines, BUT no lines or code will actually change. This used to work perfect. I've tried installing older versions of atom, same thing. This is extremely annoying. Any updates on this? It's clearly effecting a lot of users.
Well, I think I figured it out. At least on Ubuntu 16.04.3 LTS. An application I was installing (ULauncher) seems to have an effect on this issue. When I install it, this feature of atom breaks. When I remove it, and run sudo apt-get autoremove it works fine after a reboot.
For anybody who uses ULauncher, you know you have to fix a broken install when you install it for the first time. Here's what appears after sudo apt-get install -f
The following additional packages will be installed: gir1.2-keybinder-3.0 libkeybinder-3.0-0 python-backports.ssl-match-hostname python-dbus python-gi python-levenshtein python-pkg-resources python-pyinotify python-pysqlite2 python-six python-websocket python-xdg
Suggested packages: python-dbus-doc python-dbus-dbg python-gi-cairo python-setuptools python-pyinotify-doc python-pysqlite2-doc python-pysqlite2-dbg
The following NEW packages will be installed: gir1.2-keybinder-3.0 libkeybinder-3.0-0 python-backports.ssl-match-hostname python-dbus python-gi python-levenshtein python-pkg-resources python-pyinotify python-pysqlite2 python-six python-websocket python-xdg
So perhaps its one of these python packages? No clue, just hope this helps give us a clue. Remember, this might not necessarily be a ULauncher thing but ANY application or program that requires one of these packages that are screwing this feature of atom up.
If anybody can help me out who runs Ubuntu and has this issue (4982), please run a sudo dpkg -l {package-name} on the packages listed above under "The following NEW packages will be installed:"
If we get enough people to do this and cross-reference, we can triangulate that pesky package.
I can confirm that it has to be a package required from ULauncher. To test my hypothesis, I tried a few things:
1.) I set ULauncher to boot on login, rebooted, and atom was having this issue when trying to switch branches.
2.) I removed ULauncher from Startup Applications, rebooted, launched atom BEFORE starting ULauncher, and everything was working perfect.
3.) I kept ULauncher out of Startup Applications just as it was previously, rebooted, but this time I opened ULauncher BEFORE atom, and the issue of this thread occurred yet again.
It's worthy to note that it appears that everything depends on which application is started first, if I start ULauncher before atom, this issue will always result during the current session. However, if I start atom first, everything will work perfect during the current session, even if I open ULauncher as many times as I want afterwards.
I'm searching for all of atom's dependencies as Linux packages but I can't seem to find anything helpful online, does anybody know how I can view atom's dependencies?
Still having this issue in Atom 1.24.0 on MacOS 10.12.6. vi shows updated file contents but Atom keeps loading an old version. This is after doing a pull request.
@samablews please read my comments above yours. I know we are on different operating systems, but if there is a way to disable ALL startup applications on Mac, do that, then reboot. Open atom ONLY when you boot, then the console or whatever you use to switch branches. See if atom updates the files correctly.
I am not using git, but am doing something similar and my tab isn't updating. Figured out how to reproduce the issue if it helps.
$ cd projectA
$ touch diff.diff
$ atom . # Close all tabs if you have any open, it doesn't seem reproducible if you do not
$ cd ../projectB
$ atom . # Only can reproduce if two editors open in different projects
$ cd ../projectA
$ printf 'test\n1' > diff.diff
# Go to atom with projectA, hit ctrl+p, open diff.diff
# Notice test then new line then 1
$ printf 'test\n2' > diff.diff
# Does not update tab to show test 2... only if you close tab and reopen.
I also have this problem and find it very annoying. Closing and re-opening the tab is a fail because it is useful to be able to ctrl-z and ctrl-shift-z to compare the changes that happened when you switched a branch. When you close and re-open the file, those changes are lost.
I'm surprised that this is marked as "closed". It looks like this is not going to get fixed. It surprises me that folks who maintain this project don't find it annoying as well.
+1 to closing tabs that don't exist on destination branch when switching between branches. I know Atom doesn't assume workflow and that's why it leaves it open.
How about a setting that can toggle this feature on and off so user can decide?
Sorry for the not so helpful comment but this issue has made me switch to VSCode and I haven't looked back since. I'd really like to develop with non-Corporate open source projects but VSCode is so much better than the alternatives. Please feel free to reach out to everyone once Atom catches back up and I'd be more than happy to come back.
WOW... I was silent about that but... I switched to VSCode as well and it
was the best thing I ever did.
Sadly (for Atom) VSCode is much faster, much more reliable, less memory hog
and everything works (even the plugins). :)
I believe the real problem relies upon Atom itself, as it is Chrome based
and it is naturally bloated at its core.
I still have Atom installed, but for no reason at all. Even my secondary
editor is now Kate before Atom...
I would love to see Atom catching up... But, as far as I can see it will be
a very hard task.
_**Edit:** Moderator removed personal information_
Thanks everyone for the feedback on this. Unfortunately, the conversation has gotten way off the point here. I'm going to lock this issue for further comments. If people have a bug they would like to report, please open a new issue and fill out the required template.
Activity
lee-dohm commentedon Jan 10, 2015
Could you include the following information?
atom --safe?AustP commentedon Jan 11, 2015
@lee-dohm Using
atom --safefixed the issue temporarily. After step 6 I switched back and forth between new_feature and master a few more times and the issue occurred after switching for the 5th time. I'm running Windows 7 with Atom v 0.169.0AustP commentedon Jan 14, 2015
@benogle What more information do you need?
benogle commentedon Jan 14, 2015
We need whatever information can help us reproduce it, at which point we could consider it a bug. I am sadly not able to reproduce this issue
This does happen for me. Steps for this: a file on master but not on your branch, and you switch from master to the branch, it should close.
AustP commentedon Jan 14, 2015
@benogle Hmm are you trying this in Windows? I've updated to 0.172.0 and still seeing the issue.
AustP commentedon Jan 26, 2015
@benogle Do you need any more information?
AustP commentedon Feb 3, 2015
I don't know if this will help but I submitted a ticket on the git-utils repo.
Specs failing on Windows
The issue may be stemming back to libgit2 but I'm unsure.
samtechie commentedon Jul 10, 2015
I experienced a similar issue. Am using Atom 1.0 on OpenSuse 13.2 and when i switched to a different branch. The old files which I created on the other branch were still there. When I tried to close them . It asked if i should save the changes. I also think they should just disappear from the buffer.
alexcreasy commentedon Jul 16, 2015
I'm having the same problem on Fedora 20 using Atom 1.0. When switching branches I have to manually close windows and select don't save for each file that doesn't exist on the newly switched branch. I think the files should just disappear from the buffer also.
lpommers commentedon Aug 20, 2015
Just thought I would say that I've only ever experienced this when switching branches from a tool other than the command line i.e. sourceTree atom 1.0.7 OSX 10.10.5 git 2.3.2
if I switch from terminal or iterm then everything works as expected
118 remaining items
alecbz commentedon Nov 16, 2017
Solution by @ungb is pretty good, but kind of unfortunate that there's not more direct git integration here. E.g.: it'd be nice if this happened when the git branch switches, but not for general deletions otherwise (this way atom would save the buffer if it was accidentally deleted by some other mechanism).
philippgovernale commentedon Jan 30, 2018
On 1.23.3 I am still having these issues even with the solution by @ungb. Files do not update after changing branch. Not even restarting has worked so I am forced to use another text editor.
zbroniszewski commentedon Feb 12, 2018
I was not having this problem up until a couple days ago. I'm running Ubuntu 16.04.3 LTS, atom 1.2.3 downloaded by adding the repo to my system. If I completely wipe my disk, reinstall Ubuntu, install atom, and test switching branches, it will work. When I restart my computer, it stops working. In the bottom pane of atom where it tells you the branch you are on, that only changes the branch name once you give focus to atom after running for example "git checkout newBranch" in terminal. So to summarize, if I checkout a new branch, nothing will happen. When I click into atom, it will change the branch, the git diff package will highlight changed lines, BUT no lines or code will actually change. This used to work perfect. I've tried installing older versions of atom, same thing. This is extremely annoying. Any updates on this? It's clearly effecting a lot of users.
zbroniszewski commentedon Feb 12, 2018
Well, I think I figured it out. At least on Ubuntu 16.04.3 LTS. An application I was installing (ULauncher) seems to have an effect on this issue. When I install it, this feature of atom breaks. When I remove it, and run
sudo apt-get autoremoveit works fine after a reboot.For anybody who uses ULauncher, you know you have to fix a broken install when you install it for the first time. Here's what appears after
sudo apt-get install -fThe following additional packages will be installed:
gir1.2-keybinder-3.0 libkeybinder-3.0-0 python-backports.ssl-match-hostname python-dbus python-gi python-levenshtein python-pkg-resources python-pyinotify python-pysqlite2 python-six python-websocket python-xdgSuggested packages:
python-dbus-doc python-dbus-dbg python-gi-cairo python-setuptools python-pyinotify-doc python-pysqlite2-doc python-pysqlite2-dbgThe following NEW packages will be installed:
gir1.2-keybinder-3.0 libkeybinder-3.0-0 python-backports.ssl-match-hostname python-dbus python-gi python-levenshtein python-pkg-resources python-pyinotify python-pysqlite2 python-six python-websocket python-xdgSo perhaps its one of these python packages? No clue, just hope this helps give us a clue. Remember, this might not necessarily be a ULauncher thing but ANY application or program that requires one of these packages that are screwing this feature of atom up.
If anybody can help me out who runs Ubuntu and has this issue (4982), please run a
sudo dpkg -l {package-name}on the packages listed above under "The following NEW packages will be installed:"If we get enough people to do this and cross-reference, we can triangulate that pesky package.
zbroniszewski commentedon Feb 13, 2018
I can confirm that it has to be a package required from ULauncher. To test my hypothesis, I tried a few things:
1.) I set ULauncher to boot on login, rebooted, and atom was having this issue when trying to switch branches.
2.) I removed ULauncher from Startup Applications, rebooted, launched atom BEFORE starting ULauncher, and everything was working perfect.
3.) I kept ULauncher out of Startup Applications just as it was previously, rebooted, but this time I opened ULauncher BEFORE atom, and the issue of this thread occurred yet again.
It's worthy to note that it appears that everything depends on which application is started first, if I start ULauncher before atom, this issue will always result during the current session. However, if I start atom first, everything will work perfect during the current session, even if I open ULauncher as many times as I want afterwards.
I'm searching for all of atom's dependencies as Linux packages but I can't seem to find anything helpful online, does anybody know how I can view atom's dependencies?
zbroniszewski commentedon Feb 13, 2018
@philippgovernale @AlecBenzer @jcmarchi @adamsimonini @goodlux please check my recent comments, maybe we can finally figure this out after two years!
samablews commentedon Feb 16, 2018
Still having this issue in Atom 1.24.0 on MacOS 10.12.6. vi shows updated file contents but Atom keeps loading an old version. This is after doing a pull request.
zbroniszewski commentedon Feb 17, 2018
@samablews please read my comments above yours. I know we are on different operating systems, but if there is a way to disable ALL startup applications on Mac, do that, then reboot. Open atom ONLY when you boot, then the console or whatever you use to switch branches. See if atom updates the files correctly.
stanfieldr commentedon Feb 20, 2018
I am not using git, but am doing something similar and my tab isn't updating. Figured out how to reproduce the issue if it helps.
I'm running Fedora 27 with Atom 1.23.3
DmitriWolf commentedon Feb 23, 2018
I also have this problem and find it very annoying. Closing and re-opening the tab is a fail because it is useful to be able to ctrl-z and ctrl-shift-z to compare the changes that happened when you switched a branch. When you close and re-open the file, those changes are lost.
I'm surprised that this is marked as "closed". It looks like this is not going to get fixed. It surprises me that folks who maintain this project don't find it annoying as well.
Looks like I'll be switching to another editor.
izzydoescode commentedon Mar 17, 2018
+1 to closing tabs that don't exist on destination branch when switching between branches. I know Atom doesn't assume workflow and that's why it leaves it open.
How about a setting that can toggle this feature on and off so user can decide?
ktravelet commentedon Mar 17, 2018
Sorry for the not so helpful comment but this issue has made me switch to VSCode and I haven't looked back since. I'd really like to develop with non-Corporate open source projects but VSCode is so much better than the alternatives. Please feel free to reach out to everyone once Atom catches back up and I'd be more than happy to come back.
jcmarchi commentedon Mar 17, 2018
lee-dohm commentedon Mar 20, 2018
Thanks everyone for the feedback on this. Unfortunately, the conversation has gotten way off the point here. I'm going to lock this issue for further comments. If people have a bug they would like to report, please open a new issue and fill out the required template.