diff --git a/src/HexManiac.Core/ViewModels/Selection.cs b/src/HexManiac.Core/ViewModels/Selection.cs index fd35fa3b..ed4ea774 100644 --- a/src/HexManiac.Core/ViewModels/Selection.cs +++ b/src/HexManiac.Core/ViewModels/Selection.cs @@ -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); diff --git a/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs b/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs index 3e0bf27a..4fa40f66 100644 --- a/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs +++ b/src/HexManiac.Tests/Before_Baseclass/NavigationTests.cs @@ -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);