Navigation History

This commit is contained in:
Matt Parker
2025-10-29 21:01:30 +10:00
parent c3069b0e41
commit fc84823ee7
3 changed files with 10 additions and 13 deletions

View File

@@ -29,10 +29,14 @@ public partial class ForwardBackwardButtonContainer : HBoxContainer
private void OnBackwardButtonPressed()
{
_navigationHistoryService.GoBack();
var current = _navigationHistoryService.Current;
GodotGlobalEvents.Instance.FileExternallySelected.InvokeParallelFireAndForget(current!.File, current.LinePosition);
}
private void OnForwardButtonPressed()
{
_navigationHistoryService.GoForward();
var current = _navigationHistoryService.Current;
GodotGlobalEvents.Instance.FileExternallySelected.InvokeParallelFireAndForget(current!.File, current.LinePosition);
}
}

View File

@@ -170,7 +170,7 @@ public partial class IdeRoot : Control
{
await GodotGlobalEvents.Instance.FileExternallySelected.InvokeParallelAsync(file, linePosition);
}
_navigationHistoryService.ClearHistory();
_navigationHistoryService.StartRecording();
// Select the selected tab
var selectedFile = filesToOpen.SingleOrDefault(f => f.IsSelected);
if (selectedFile.Item1 is not null) await GodotGlobalEvents.Instance.FileExternallySelected.InvokeParallelAsync(selectedFile.Item1, selectedFile.Item2);