Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
furesoft committed Oct 11, 2024
1 parent 0b249c2 commit d257c54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MimaSim/MimaSim.Desktop/cache.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"input": "\"load 0x01\\r\\nmov accumulator, x\\r\\nload 0x02\\r\\nmov accumulator, y\\r\\nadd\""
"input": "\"load 0x01\\r\\nmov accumulator, x\\r\\nload 0x02\\r\\nmov accumulator, y\\r\\nadd\"",
"language": "\"Assembly\""
}
2 changes: 2 additions & 0 deletions src/MimaSim/MimaSim/ViewModels/ExecutionTabViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public LanguageName SelectedLanguage

SelectedSample = null;
Highlighting = HighlightingManager.Instance.GetDefinitionByExtension(GetExtensionForLanguage(value));
Locator.Current.GetService<ICache>()!.AddOrUpdate("language", value.ToString());
}
}

Expand Down Expand Up @@ -203,6 +204,7 @@ public ExecutionTabViewModel()

var cache = Locator.Current.GetService<ICache>();
_source = cache!.Get<string>("input")!;
_selectedLanguage = Enum.Parse<LanguageName>(cache!.Get<string>("language")!);
}

private string GetExtensionForLanguage(LanguageName language)
Expand Down

0 comments on commit d257c54

Please sign in to comment.