Skip to content

Commit

Permalink
addressed bug #55
Browse files Browse the repository at this point in the history
  • Loading branch information
Crypt32 committed Dec 9, 2024
1 parent 3208a88 commit 9f3f79e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Asn1Editor/API/ViewModel/MainWindowVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ async Task createTabFromFile(String file, Boolean useDefaultTab = false) {
Asn1DocumentVM tab;
if (useDefaultTab && Tabs.Any()) {
tab = Tabs[0];
tab.Path = file;
} else {
// force set 'useDefaultTab' to 'false' if default tab is requested, but there are no any available tabs.
useDefaultTab = false;
tab = new Asn1DocumentVM(NodeViewOptions, TreeCommands) {
Path = file
};
Expand All @@ -111,7 +114,9 @@ async Task createTabFromFile(String file, Boolean useDefaultTab = false) {
Tools.MsgBox("Read Error", ex.Message);
return;
}
addTabToList(tab);
if (!useDefaultTab) {
addTabToList(tab);
}
}

#region Read content to tab
Expand Down

0 comments on commit 9f3f79e

Please sign in to comment.