Script undoes my changes when I switch windows

Godot Version

4.6.1

Question

I’m new to godot and currently learning gdscript but there’s something driving me crazy.

When I’m working on a script, if I switch windows tabs - let’s say to watch a quick tutorial on youtube for instance - and then switch back to godot, it automatically undoes all my changes on the script (unless I had saved it before switching windows). As someone who is constantly switching windows tabs this is extremely annoying, and I haven’t found anyone else complaining about this so I’m pretty sure I’m missing something obvious here.

Is there any way to stop godot to undo changes on unsaved scripts when switching windows tabs?


Are you running Godot in a web browser tab?

Nope. I should’ve said switch windows.

I’ve never encountered this. What OS are you using?

1 Like

Windows. I looks like it only happens when there’s an error in the code.

I recorded a video but apparently I can’t upload attachments as I’m a new user in this forum :smiling_face_with_tear:

lemme try it…

Nahh,doesn’t happen to me.
How do you change the between the windows? the normal way or by using a hot key
The code I wrote:

extends Node2D

func _ready() -> void:
	print("NEVER GONNA GIVE YOU UP");

using namespace std;
void duh()
{
	cout << "NEVER GONNA SAY U A LIE!" << endl;
}
1 Like

I uploaded to youtube:

I think it’s some kind of auto-correct

Godot doesn’t have auto-correct by far I know…
That’s an odd one lol

Does it only happening with an unsaved script? What happens when you save it once?

It happens with every script, even saved ones.

I cannot reproduce that. My scripts, saved or unsaved, errors or not, do not disappear or get altered in any way when I pop a Chrome or Edge browser window on top of them.

I’m running Windows 11 Pro and 4 monitors.

The best guess I have is that Chrome takes up so much RAM when it’s running, that it’s wiping out whatever is in memory in Godot. To test this, you could close every program you have running and close all but one browser tab. See if that makes a difference.

You could also run Task Manager and watch memory usage. Right-click the Windows Taskbar and select Task Manager.

You could also popping the Script Editor out to its own window and see if that solves it.

It’s definitely not a memory issue. It happens whenever I switch tabs, even if it’s not a browser. I closed everything and switch from godot to an empty folder in file explorer and the same thing happened. Also, task memory shows memory usage is fairly low.

Popping the scripts editor out didn’t solve the issue either, unfortunately.

I’m running on a brand new laptop (thinkpad x9-15 gen), on windows 11 home.

There. This might me your problem :rofl:

Don’t use vibe coded operating systems.

3 Likes

imposter spotted :rofl:

1 Like