mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-26 08:20:04 -05:00
Fixed save-as not updating RecentFile (#92)
This commit is contained in:
@@ -984,6 +984,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
|
||||
fileSystem.RemoveListenerForFile(viewPort.FileName, viewPort.ConsiderReload);
|
||||
using (new StubDisposable { Dispose = () => fileSystem.AddListenerToFile(viewPort.FileName, viewPort.ConsiderReload) }) {
|
||||
innerCommand.Execute(fileSystem);
|
||||
UpdateRecentFiles(viewPort.FileName);
|
||||
}
|
||||
} else {
|
||||
if (tab is ViewPort vp) vp.MaxDiffSegmentCount = this.maxDiffSegCount;
|
||||
|
||||
@@ -631,6 +631,21 @@ ApplicationVersion = '''0.1.0'''
|
||||
Assert.IsType<PokemonModel>(viewPort.Model);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Tab_SaveAs_UpdatesRecentFiles() {
|
||||
var filename = "Test.gba";
|
||||
|
||||
editor.Add(new StubViewPort {
|
||||
FileName = filename,
|
||||
SaveAs = new StubCommand {
|
||||
CanExecute = arg => true,
|
||||
},
|
||||
});
|
||||
|
||||
editor.SaveAs.Execute();
|
||||
Assert.Contains(filename, editor.RecentFiles);
|
||||
}
|
||||
|
||||
private StubTabContent CreateClosableTab() {
|
||||
var tab = new StubTabContent();
|
||||
var close = new StubCommand { CanExecute = arg => true };
|
||||
|
||||
Reference in New Issue
Block a user