Skip to content

Commit

Permalink
-修复拖放打开多个文件时没有正确打开所有文件的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Aug 25, 2023
1 parent dc2f7db commit 51e6b66
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions App/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,7 @@ internal void OpenFileWithEditor(FilePath path) {
return;
}
}
SelectFunctionList(Function.Editor);
c = GetActiveFunctionControl() as EditorControl;
c = SelectFunctionList(Function.Editor) as EditorControl;
if (String.IsNullOrEmpty(path)) {
c.ExecuteCommand(Commands.Open);
}
Expand All @@ -483,7 +482,7 @@ IEnumerable<IDocumentEditor> GetOpenedDocumentEditors() {
}
}

internal void SelectFunctionList(Function func) {
internal Control SelectFunctionList(Function func) {
if (func == Function.PatcherOptions) {
ShowDialogWindow(new PatcherOptionForm(false) { Options = AppContext.Patcher });
}
Expand All @@ -509,7 +508,7 @@ internal void SelectFunctionList(Function func) {
if (String.IsNullOrEmpty(p) == false) {
c.ExecuteCommand(Commands.OpenFile, p);
}
return;
return c;
}
}
var t = new TabPage(c.FunctionName) {
Expand All @@ -532,11 +531,13 @@ internal void SelectFunctionList(Function func) {
c.Dock = DockStyle.Fill;
t.Controls.Add(c);
_FunctionContainer.SelectedTab = t;
if (String.IsNullOrEmpty(p) == false) {
if (func == Function.Inspector && String.IsNullOrEmpty(p) == false) {
c.ExecuteCommand(Commands.OpenFile, p);
}
AcceptButton = c.DefaultButton;
return c;
}
return null;
}

void FunctionDeselected(object sender, TabControlEventArgs args) {
Expand Down

0 comments on commit 51e6b66

Please sign in to comment.