mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 05:06:35 -05:00
when the find tab finds data in an array, have that line start at the start of the element, not directly with the search results.
This commit is contained in:
@@ -633,8 +633,19 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
|
||||
public IChildViewPort CreateChildView(int startAddress, int endAddress) {
|
||||
var child = new ChildViewPort(this);
|
||||
child.Goto.Execute(startAddress.ToString("X2"));
|
||||
child.SelectionEnd = child.ConvertAddressToViewPoint(endAddress);
|
||||
|
||||
var run = Model.GetNextRun(startAddress);
|
||||
if (run is ArrayRun array) {
|
||||
var offsets = array.ConvertByteOffsetToArrayOffset(startAddress);
|
||||
var lineStart = array.Start + array.ElementLength * offsets.ElementIndex;
|
||||
child.Goto.Execute(lineStart.ToString("X2"));
|
||||
child.SelectionStart = child.ConvertAddressToViewPoint(startAddress);
|
||||
child.SelectionEnd = child.ConvertAddressToViewPoint(endAddress);
|
||||
} else {
|
||||
child.Goto.Execute(startAddress.ToString("X2"));
|
||||
child.SelectionEnd = child.ConvertAddressToViewPoint(endAddress);
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user