diff --git a/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs b/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs index 3e926a3..4f56064 100644 --- a/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs +++ b/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs @@ -9,7 +9,6 @@ namespace SharpIDE.Application.Features.FilePersistence; /// Holds the in memory copies of files, and manages saving/loading them to/from disk. public class IdeOpenTabsFileManager { - public static IdeOpenTabsFileManager Instance { get; set; } = null!; private ConcurrentDictionary>> _openFiles = new(); /// Implicitly 'opens' a file if not already open, and returns the text. diff --git a/src/SharpIDE.Godot/IdeRoot.cs b/src/SharpIDE.Godot/IdeRoot.cs index 2a175f4..6f94ae8 100644 --- a/src/SharpIDE.Godot/IdeRoot.cs +++ b/src/SharpIDE.Godot/IdeRoot.cs @@ -48,7 +48,6 @@ public partial class IdeRoot : Control GodotGlobalEvents.Instance = new GodotGlobalEvents(); GlobalEvents.Instance = new GlobalEvents(); BuildService.Instance = new BuildService(); // TODO: Sort out this mess with singletons, especially access across Application services - IdeOpenTabsFileManager.Instance = new IdeOpenTabsFileManager(); } public override void _ExitTree() diff --git a/src/SharpIDE.Godot/IdeWindow.cs b/src/SharpIDE.Godot/IdeWindow.cs index d5193ee..8ea9174 100644 --- a/src/SharpIDE.Godot/IdeWindow.cs +++ b/src/SharpIDE.Godot/IdeWindow.cs @@ -47,6 +47,7 @@ public partial class IdeWindow : Control // PrintOrphanNodes(); } + // TODO: Problematic, as this is called even when the focus shifts to an embedded subwindow, such as a popup private void OnFocusExited() { _ = Task.GodotRun(async () => await _openTabsFileManager.SaveAllOpenFilesAsync());