diff --git a/src/HexManiac.Core/ViewModels/ViewPort.cs b/src/HexManiac.Core/ViewModels/ViewPort.cs index 96a905c4..6d5c52b8 100644 --- a/src/HexManiac.Core/ViewModels/ViewPort.cs +++ b/src/HexManiac.Core/ViewModels/ViewPort.cs @@ -613,18 +613,19 @@ namespace HavenSoft.HexManiac.Core.ViewModels { } run = Model.GetNextRun(index); - var cellToText = new ConvertCellToText(Model, run.Start); - var cell = currentView[point.X, point.Y]; - if (run is PCSRun pcs) { + if (run is PCSRun || run is AsciiRun) { for (int i = index; i < run.Start + run.Length; i++) history.CurrentChange.ChangeData(Model, i, 0xFF); var length = PCSString.ReadString(Model, run.Start, true); - Model.ObserveRunWritten(history.CurrentChange, new PCSRun(Model, run.Start, length, run.PointerSources)); + if (run is PCSRun) Model.ObserveRunWritten(history.CurrentChange, new PCSRun(Model, run.Start, length, run.PointerSources)); RefreshBackingData(); SelectionStart = scroll.DataIndexToViewPoint(index - 1); return; } + var cellToText = new ConvertCellToText(Model, run.Start); + var cell = currentView[point.X, point.Y]; + if (run is ArrayRun array) { var offsets = array.ConvertByteOffsetToArrayOffset(index); if (array.ElementContent[offsets.SegmentIndex].Type == ElementContentType.PCS) { diff --git a/src/HexManiac.Core/ViewModels/Visitors/ContextItemFactory.cs b/src/HexManiac.Core/ViewModels/Visitors/ContextItemFactory.cs index abecc98a..4c200ecb 100644 --- a/src/HexManiac.Core/ViewModels/Visitors/ContextItemFactory.cs +++ b/src/HexManiac.Core/ViewModels/Visitors/ContextItemFactory.cs @@ -105,7 +105,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Visitors { public void Visit(ErrorPCS pcs, byte data) => Visit((PCS)null, data); - public void Visit(Ascii ascii, byte data) { } + public void Visit(Ascii ascii, byte data) => Results.AddRange(GetFormattedChildren()); public void Visit(Integer integer, byte data) { var arrayRun = (ArrayRun)ViewPort.Model.GetNextRun(ViewPort.Tools.TableTool.Address);