+203
Completed

Update tabs after renaming file

sofa-420 13 years ago updated by Anders Ingemann 7 years ago 13
When you rename a file in the sidebar, if you have that file open in a tab it'd be nice if it knew it was renamed, and would save to the correct file instead of essentially copying the new file back.

Answer

Answer
Completed
Added in 2181
yes, the current behavior is counter-intuitive and unlike other editors. 

current behaviour is quite confusing.

+1

This always bites me in the ass and interrupts flow.


When renaming a file, any tabs that had the file open should be "renamed" as well and be bound to the newly named file.


BTW, is there a default keybinding for "rename current file" for the tab under focus?

This always catches me out - if you have the file in an open tab and rename it, but forget to close the old one, you can end up with the old one 'coming back' if you do a 'save all' later.
+1
I am not sure why this hasn't already been implemented! It keeps annoying the hell out of me when renaming a file and having a tab open. Most editors/ides I've worked with (Eclipse, VS.Net, etc) do this by default and saves me a bunch of time.
+1
Yes this is one of the issues I encounter most often. Please please fix this!
This made me lose so much time, so many times :(
It is pretty confusing as it is now. I don't know of any other editor that behaves this way. Please change it.
+1
This happened to me again just the other day, I kept changing a file and saving it, but my changes weren't showing in my web app. I was about to throw my laptop out the window and it was because I renamed the file, thought I reopened it but didn't, so I kept saving the file back into its old directory. UGH!!!!
Answer
Completed
Added in 2181

Sorry is that really added?

I'm using sublime text 3 (3126);

```

subl foo.c

mv foo.c bar.c

```

now the tab containing foo.c is marked as `unsaved` instead of having it's file name updated

It is. You are using `mv` outside of sublime text, it's quite a bit more complex to detect changes outside than it is when renaming through ST.

The issue was "When you rename a file in the sidebar" :-)