diff --git a/src/HexManiac.Core/ViewModels/ViewPort.cs b/src/HexManiac.Core/ViewModels/ViewPort.cs index aadc2c91..9da91fe8 100644 --- a/src/HexManiac.Core/ViewModels/ViewPort.cs +++ b/src/HexManiac.Core/ViewModels/ViewPort.cs @@ -2200,7 +2200,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels { #endregion public IChildViewPort CreateChildView(int startAddress, int endAddress) { - var child = new ChildViewPort(this, dispatcher, Singletons) { PreferredWidth = 16, Width = Math.Min(24, Width) }; + var child = new ChildViewPort(this, dispatcher, Singletons) { AllowMultipleElementsPerLine = true, PreferredWidth = 16, Width = Math.Min(24, Width) }; var run = Model.GetNextRun(startAddress); if (run is ArrayRun array) { diff --git a/src/HexManiac.Tests/BaseViewModelTestClass.cs b/src/HexManiac.Tests/BaseViewModelTestClass.cs index ba6bd1fc..18e190d4 100644 --- a/src/HexManiac.Tests/BaseViewModelTestClass.cs +++ b/src/HexManiac.Tests/BaseViewModelTestClass.cs @@ -29,7 +29,7 @@ namespace HavenSoft.HexManiac.Tests { New = new New(FileSystem, Singletons); Data = new byte[modelLength]; Model = new PokemonModel(Data, singletons: Singletons); - ViewPort = new ViewPort("file.txt", Model, InstantDispatch.Instance, Singletons) { Width = 0x10, Height = 0x10 }; + ViewPort = new ViewPort("file.txt", Model, InstantDispatch.Instance, Singletons) { AllowMultipleElementsPerLine = true, Width = 0x10, Height = 0x10 }; ViewPort.OnError += (sender, e) => { if (!string.IsNullOrEmpty(e)) Errors.Add(e); }; ViewPort.OnMessage += (sender, e) => Messages.Add(e); } diff --git a/src/HexManiac.Tests/Before_Baseclass/ArrayRunTests.cs b/src/HexManiac.Tests/Before_Baseclass/ArrayRunTests.cs index d77e00b3..a94a8b42 100644 --- a/src/HexManiac.Tests/Before_Baseclass/ArrayRunTests.cs +++ b/src/HexManiac.Tests/Before_Baseclass/ArrayRunTests.cs @@ -1157,7 +1157,7 @@ namespace HavenSoft.HexManiac.Tests { private static void StandardSetup(out byte[] data, out PokemonModel model, out ViewPort viewPort) { data = new byte[0x200]; model = new PokemonModel(data); - viewPort = new ViewPort("file.txt", model, InstantDispatch.Instance, BaseViewModelTestClass.Singletons) { Width = 0x10, Height = 0x10 }; + viewPort = new ViewPort("file.txt", model, InstantDispatch.Instance, BaseViewModelTestClass.Singletons) { AllowMultipleElementsPerLine = true, Width = 0x10, Height = 0x10 }; } private static void WriteStrings(byte[] buffer, int start, params string[] content) { diff --git a/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs b/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs index fc835572..b131c238 100644 --- a/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs +++ b/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs @@ -458,7 +458,7 @@ namespace HavenSoft.HexManiac.Tests { private void StandardSetup(out byte[] data, out PokemonModel model, out ViewPort viewPort) { data = Enumerable.Repeat((byte)0xFF, 0x200).ToArray(); model = new PokemonModel(data); - viewPort = new ViewPort("file.txt", model, InstantDispatch.Instance, BaseViewModelTestClass.Singletons) { Width = 0x10, Height = 0x10 }; + viewPort = new ViewPort("file.txt", model, InstantDispatch.Instance, BaseViewModelTestClass.Singletons) { AllowMultipleElementsPerLine = true, Width = 0x10, Height = 0x10 }; } } } diff --git a/src/HexManiac.Tests/Before_Baseclass/NestedTablesTests.cs b/src/HexManiac.Tests/Before_Baseclass/NestedTablesTests.cs index b29ad5eb..eb163ea8 100644 --- a/src/HexManiac.Tests/Before_Baseclass/NestedTablesTests.cs +++ b/src/HexManiac.Tests/Before_Baseclass/NestedTablesTests.cs @@ -20,7 +20,7 @@ namespace HavenSoft.HexManiac.Tests { public NestedTablesTests() { model = new PokemonModel(data); - viewPort = new ViewPort("file.txt", model, InstantDispatch.Instance) { Width = 0x10, Height = 0x10 }; + viewPort = new ViewPort("file.txt", model, InstantDispatch.Instance) { AllowMultipleElementsPerLine = true, Width = 0x10, Height = 0x10 }; viewPort.OnError += (sender, e) => errors.Add(e); viewPort.OnMessage += (sender, e) => messages.Add(e); } diff --git a/src/HexManiac.Tests/Before_Baseclass/ViewPortCursorTests.cs b/src/HexManiac.Tests/Before_Baseclass/ViewPortCursorTests.cs index 22359eef..aa0bfa1b 100644 --- a/src/HexManiac.Tests/Before_Baseclass/ViewPortCursorTests.cs +++ b/src/HexManiac.Tests/Before_Baseclass/ViewPortCursorTests.cs @@ -1,16 +1,15 @@ using HavenSoft.HexManiac.Core; using HavenSoft.HexManiac.Core.Models; using HavenSoft.HexManiac.Core.Models.Runs; -using HavenSoft.HexManiac.Core.Models.Runs.Sprites; using HavenSoft.HexManiac.Core.ViewModels; using HavenSoft.HexManiac.Core.ViewModels.Visitors; -using System; -using System.Collections.Generic; using System.Linq; using Xunit; namespace HavenSoft.HexManiac.Tests { public class ViewPortCursorTests { + private ViewPort NewViewPort(LoadedFile file) => new ViewPort(file) { AllowMultipleElementsPerLine = true, Width = 5, Height = 5 }; + [Fact] public void CursorCanMoveAllFourDirections() { var loadedFile = new LoadedFile("test", new byte[25]); @@ -106,7 +105,7 @@ namespace HavenSoft.HexManiac.Tests { [Fact] public void ScrollingUpdatesSelection() { var loadedFile = new LoadedFile("test", new byte[25]); - var viewPort = new ViewPort(loadedFile) { Width = 5, Height = 5 }; + var viewPort = NewViewPort(loadedFile); viewPort.SelectionStart = new Point(0, 2); viewPort.SelectionEnd = new Point(4, 2); @@ -119,7 +118,7 @@ namespace HavenSoft.HexManiac.Tests { [Fact] public void ForwardSelectionWorks() { var loadedFile = new LoadedFile("test", new byte[25]); - var viewPort = new ViewPort(loadedFile) { Width = 5, Height = 5 }; + var viewPort = NewViewPort(loadedFile); viewPort.SelectionStart = new Point(2, 1); viewPort.SelectionEnd = new Point(3, 3); @@ -130,7 +129,7 @@ namespace HavenSoft.HexManiac.Tests { [Fact] public void BackSelectionWorks() { var loadedFile = new LoadedFile("test", new byte[25]); - var viewPort = new ViewPort(loadedFile) { Width = 5, Height = 5 }; + var viewPort = NewViewPort(loadedFile); viewPort.SelectionStart = new Point(3, 3); viewPort.SelectionEnd = new Point(2, 1); diff --git a/src/HexManiac.Tests/New.cs b/src/HexManiac.Tests/New.cs index 432c203e..2a984b18 100644 --- a/src/HexManiac.Tests/New.cs +++ b/src/HexManiac.Tests/New.cs @@ -16,7 +16,7 @@ namespace HavenSoft.HexManiac.Tests { this.singletons = singletons; } - public EditorViewModel EditorViewModel() => new EditorViewModel(fs, singletons.WorkDispatcher, false); + public EditorViewModel EditorViewModel() => new EditorViewModel(fs, singletons.WorkDispatcher, false) { AllowMultipleElementsPerLine = true }; public IDataModel PokemonModel(byte[] data, StoredMetadata metadata) => new PokemonModel(data, metadata, singletons);