mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-05-17 18:38:15 -05:00
fix plural "best match" goto
plural worked for finding anchors, but didn't work for best-match
This commit is contained in:
parent
996d17fe01
commit
a080dedbdb
|
|
@ -194,10 +194,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
|||
GotoAddress(result + offset);
|
||||
} else {
|
||||
address = address.ToLower().Trim();
|
||||
var options = model.GetAutoCompleteAnchorNameOptions(address).ToList();
|
||||
if (!address.Contains("/") && options.All(option => !option.ToLower().Contains(address))) {
|
||||
options = options.Concat(model.GetAutoCompleteAnchorNameOptions("/" + address)).ToList();
|
||||
}
|
||||
var options = model.GetExtendedAutocompleteOptions(address);
|
||||
if (options.Count == 1) {
|
||||
anchor = this.model.GetAddressFromAnchor(new ModelDelta(), -1, options[0]);
|
||||
GotoAddress(anchor + offset);
|
||||
|
|
|
|||
|
|
@ -445,6 +445,17 @@ namespace HavenSoft.HexManiac.Tests {
|
|||
Assert.Equal(0x100, test.ViewPort.DataOffset);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnchorWithPluralNamePart_GotoSinglularVersion_Works() {
|
||||
var test = new BaseViewModelTestClass();
|
||||
test.ViewPort.Edit("@100 ^test.abilities.text @00 ");
|
||||
|
||||
test.ViewPort.Goto.Execute("ability.tex");
|
||||
|
||||
Assert.Empty(test.Errors);
|
||||
Assert.Equal(0x100, test.ViewPort.DataOffset);
|
||||
}
|
||||
|
||||
private void StandardSetup(out byte[] data, out PokemonModel model, out ViewPort viewPort) {
|
||||
data = Enumerable.Repeat((byte)0xFF, 0x200).ToArray();
|
||||
model = new PokemonModel(data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user