diff --git a/src/SharpIDE.Godot/Features/SolutionExplorer/SolutionExplorerPanel.cs b/src/SharpIDE.Godot/Features/SolutionExplorer/SolutionExplorerPanel.cs index 5599ada..b786106 100644 --- a/src/SharpIDE.Godot/Features/SolutionExplorer/SolutionExplorerPanel.cs +++ b/src/SharpIDE.Godot/Features/SolutionExplorer/SolutionExplorerPanel.cs @@ -98,6 +98,14 @@ public partial class SolutionExplorerPanel : MarginContainer { await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); var task = GodotGlobalEvents.Instance.FileSelected.InvokeParallelAsync(file, fileLinePosition); + // First check if the file is already selected + var selectedItem = _tree.GetSelected(); + if (selectedItem is not null) + { + var selectedFile = selectedItem.GetTypedMetadata?>(0)?.Item; + if (selectedFile == file) + return; + } var item = FindItemRecursive(_tree.GetRoot(), file); if (item is not null) {