Currently, when we undo a file rename we simply leave an open buffer on the file that no longer exists (i.e. the one that was undone.) We do this because it's simple.
A smarter solution might be to see if we can examine the results of the undo and determine which file we should be visiting instead. If the undo results include a description like "undid rename of foo.py to bar.py", then we can try visiting foo.py and removing the bar.py buffer.
I don't know if this information actually comes out of undo. I haven't looked into it yet.
Currently, when we undo a file rename we simply leave an open buffer on the file that no longer exists (i.e. the one that was undone.) We do this because it's simple.
A smarter solution might be to see if we can examine the results of the undo and determine which file we should be visiting instead. If the undo results include a description like "undid rename of foo.py to bar.py", then we can try visiting foo.py and removing the bar.py buffer.
I don't know if this information actually comes out of undo. I haven't looked into it yet.