Ascii improvements

* Backspace on an ascii run behaves better.
* Ascii run has right-click -> remove format option
This commit is contained in:
Benjamin Popp
2019-06-08 13:29:02 -05:00
parent ba2bbeca7c
commit 2697ea3dd2
2 changed files with 6 additions and 5 deletions

View File

@@ -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) {

View File

@@ -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);