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.
Files added/removed have weird behavior when switching branches #693
When I switch to a branch where a file I've been editing doesn't exist, Atom marks it as 'changed'. That's not really right: it's gone. I'd expect atom to either figure out that the file I was editing doesn't exist on this branch and close the tab, or to mark it as 'doesn't exist'.
Quitting and restarting doesn't help; the tabs were part of my project session so they just come right back, marked as changed.
When I switch to a branch where a file I've been editing doesn't exist,
Atom marks it as 'changed'. That's not really right: it's gone. I'd
expect atom to either figure out that the file I was editing doesn't exist
on this branch and close the tab, or to mark it as 'doesn't exist'.
Quitting and restarting doesn't help; the tabs were part of my project
session so they just come right back, marked as changed.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/693
.
Are you guys feeling that the buffer should close when the file is
deleted? Either from the git, the tree-view, any place.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/693#issuecomment-23582526
.
That's the key for me. I appreciate vim's behavior of keeping a buffer around after I delete a file manually; I rather expect that. When I switch branches in git, it is incorrect to call it modified, it's just not there right now.
So:
git branch change: close buffer
file removed otherwise: leave it open, mark as modified
This is driving me nuts too, especially since I use auto-save so tabbing off the editor saves all the files to my working dir which means you then have to pick apart the new branch you are on vs. the files that were in the old branch. I also noticed that manually closing the buffers and clicking don't save still seems to save the buffers to disk.
I'm not seeing this because (for no good reason) I am vigilant about closing files I'm not using. But I'd like to tackle fixing this issue once and for all! If I had a list of steps to reproduce the problem that would help me out a lot because otherwise I'd just be guessing at what situations cause the problem.
I just wanted to make sure I was solving your exact problem. And just to clarify, the expected behavior here is the buffer will close when the file is deleted. Or that the file will never prompt for saving.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Activity
jbarnette commentedon Aug 8, 2013
This drives me crazy too.
On Thu, Aug 8, 2013 at 3:46 PM, Ben Lavender [email protected]:
kevinsawicki commentedon Aug 30, 2013
Are you guys feeling that the buffer should close when the file is deleted? Either from the git, the tree-view, any place.
benogle commentedon Aug 30, 2013
I'd say no, it should not close. Sublime just marks it as modified, FWIW.
On Fri, Aug 30, 2013 at 12:01 PM, Kevin Sawicki [email protected]:
jbarnette commentedon Aug 30, 2013
If I change branches, I don't care in the slightest about unmodified buffers pointing at files that don't exist on my destination branch.
bhuga commentedon Aug 30, 2013
That's the key for me. I appreciate vim's behavior of keeping a buffer around after I delete a file manually; I rather expect that. When I switch branches in git, it is incorrect to call it modified, it's just not there right now.
So:
Is that possible?
kevinsawicki commentedon Aug 30, 2013
@bhuga it is, we have the technology
probablycorey commentedon Aug 30, 2013
How can we tell if the file was removed by git vs some other processes?
kevinsawicki commentedon Aug 30, 2013
@probablycorey Atom can watch
.git/HEADfor branch changesprobablycorey commentedon Aug 30, 2013
Seems crazy, but so do airplanes and they work great.
tclem commentedon Sep 18, 2013
This is driving me nuts too, especially since I use auto-save so tabbing off the editor saves all the files to my working dir which means you then have to pick apart the new branch you are on vs. the files that were in the old branch. I also noticed that manually closing the buffers and clicking don't save still seems to save the buffers to disk.
probablycorey commentedon Dec 5, 2013
I'm not seeing this because (for no good reason) I am vigilant about closing files I'm not using. But I'd like to tackle fixing this issue once and for all! If I had a list of steps to reproduce the problem that would help me out a lot because otherwise I'd just be guessing at what situations cause the problem.
bhuga commentedon Dec 5, 2013
The new file is open and marked as modified.
jbarnette commentedon Dec 5, 2013
You'll be prompted to save changes to the deleted file.
jbarnette commentedon Dec 5, 2013
You'll be prompted to save changes to the deleted file.
jbarnette commentedon Dec 5, 2013
I really don't feel like it's hard to find examples of this.
probablycorey commentedon Dec 5, 2013
I just wanted to make sure I was solving your exact problem. And just to clarify, the expected behavior here is the buffer will close when the file is deleted. Or that the file will never prompt for saving.
Only mark a deleted file as modified if it was previously modified.
jbarnette commentedon Dec 12, 2013
❤️❤️❤️❤️❤️
lock commentedon Jan 27, 2019
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!