Why does the editor keep deleting lines of incomplete code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 1zacster
:warning: Old Version Published before Godot 3 was released.

I will be editing a gdscript and write say half a line of code. I have two monitors and I need to check something in the class reference. I click the other window and BAM all the work I just did goes away. I have to resort to ctrl A and ctrl V whenever I want to click away from the code window from feat my work will go away. How can I disable or fix this functionality?

Running on debian 8 jessie with the latest build.

edit to clarify:
I will have say half a line of code, the debugger scans my code and marks an error line. If I click to the end of the half-done line to complete it that line and the WHOLE function it is in goes away. I can’t help but feel like this is either unintended functionality or baby tier coding help.

I confirm this bug on ubuntu mate 16.04 as well, maybe it’s a Linux-only related problem?

erasmo85 | 2016-06-04 20:29

:bust_in_silhouette: Reply From: duke_meister

I’m using 2.0.3 (on Windows) and haven’t seen this ever. I’ve only seen ‘disappearing’ code when inadvertently using built-in scripts when I started out.

:bust_in_silhouette: Reply From: Zylann

I had this issue on Windows, it happens when the file is not saved yet. Changes you make get reverted, and you also loose undo history.
This bug is known: Script Editor clears unsaved changes when changing application · Issue #4444 · godotengine/godot · GitHub
The workaround is to save aggressively, when you finish a line or focus another application.