From a31043c331f979a57c232b2cdace2fba4fcfb3ef Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Sun, 7 Apr 2019 14:35:38 -0500 Subject: [PATCH] when editing a table anchor, resize and bring that table to the top --- src/HexManiac.Core/ViewModels/ViewPort.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/HexManiac.Core/ViewModels/ViewPort.cs b/src/HexManiac.Core/ViewModels/ViewPort.cs index 899456fe..f701cae4 100644 --- a/src/HexManiac.Core/ViewModels/ViewPort.cs +++ b/src/HexManiac.Core/ViewModels/ViewPort.cs @@ -261,6 +261,12 @@ namespace HavenSoft.HexManiac.Core.ViewModels { var errorInfo = PokemonModel.ApplyAnchor(Model, history.CurrentChange, index, AnchorText); if (errorInfo == ErrorInfo.NoError) { OnError?.Invoke(this, string.Empty); + if (run is ArrayRun array) { + // to keep from double-updating the AnchorText + selection.PropertyChanged -= SelectionPropertyChanged; + Goto.Execute(index.ToString("X2")); + selection.PropertyChanged += SelectionPropertyChanged; + } RefreshBackingData(); } else { OnError?.Invoke(this, errorInfo.ErrorMessage); @@ -1189,7 +1195,10 @@ namespace HavenSoft.HexManiac.Core.ViewModels { ClearEdits(point); UpdateToolsFromSelection(index); - if (errorInfo == ErrorInfo.NoError) return true; + if (errorInfo == ErrorInfo.NoError) { + if (Model.GetNextRun(index) is ArrayRun array && array.Start == index) Goto.Execute(index.ToString("X2")); + return true; + } if (errorInfo.IsWarning) { OnMessage?.Invoke(this, errorInfo.ErrorMessage);