### Godot version

v4.2.dev4.mono.official [549fcce5f]

### System information

window10 64bit

### Issue description

![GIF 2023-9-1 22-39-07](https://github.com/godotengine/godot/assets/35988767/d7be4a45-f5f0-4408-8758-f4bf9f3c9c5d)


### Steps to reproduce

/

### Minimal reproduction project

/
bool res = (access == ACCESS_RESOURCES);
	String cd = get_current_dir();
	if (!cd.ends_with("/")) {
		cd += "/";
	}
	Vector<String> favorited = EditorSettings::get_singleton()->get_favorites();
	bool found = false;
	for (int i = 0; i < favorited.size(); i++) {
		bool cres = favorited[i].begins_with("res://");
		if (cres != res) {
			continue;
		}
		if (favorited[i] == cd) {
			found = true;
			break;
		}
	}
	if (found) {
		favorited.erase(cd);
	} else {
		favorited.push_back(cd);
	}
	EditorSettings::get_singleton()->set_favorites(favorited);
	_update_favorites();
}
void EditorFileDialog::_update_recent() {