Open oguzhantopcu opened 4 years ago
I followed your steps, but the editor is showing the expected behaviour (opening scene B). Can you record this behaviour?
Here you are.
Sorry for the late late reply, have been pretty busy with other stuff :stuck_out_tongue:
From what I can tell, that happens because even though Godot deletes a file, it doesn't remove if from the currently opened files. And then, when you open the new file that has the same name as the old one, Godot reuses what's already opened for that.
I think the best solution is to simply remove the tab from the opened files if the user deletes it from the FileSystem dock.
Well, there are workarounds, obviously. I can live with this bug, too. But this is a bug.
At the and of the day It is up to you to fix it or not since we are all volunteers here.
I looked at the code of the PR for this issue and the old behavior looks like intended. This is similar to e.g. VS Code where deleting an opened script will mark its tab as deleted. Maybe we could do similar for scene tabs instead of removing them?
See also #40515
Ah, I didn't know there was a proposal already :stuck_out_tongue:
I think a system like VSCode would be better, but not entirely as it's described in the proposal. I'll write a more detailed opinion there: https://github.com/godotengine/godot-proposals/issues/1550
IMHO VS Code's behaviour is pretty OK, too.
See https://github.com/godotengine/godot/pull/42885#issuecomment-1175037982 for a suggestion on how to solve this bug.
For the usability part around deleted scenes/scripts, discussion can continue in https://github.com/godotengine/godot-proposals/issues/1550.
Godot version: 3.2.1
OS/device including version: Fedora 32/KDE, it does not matter.
Issue description: Delete, rename, open flow confuses godot editor.
Steps to reproduce: 1.) Open a scene, 1.tscn (scene A). 2.) Open a scene, 2.tscn (scene B). 3.) Delete scene 1.tscn. 4.) Rename scene 2.tscn to scene 1.tscn. 5.) Open 1.tscn.
Expected behaviour: show scene B Actual behaviour: shows scene A