diff --git a/Bonsai.Editor/EditorForm.cs b/Bonsai.Editor/EditorForm.cs index b497556c4..b20d4f378 100644 --- a/Bonsai.Editor/EditorForm.cs +++ b/Bonsai.Editor/EditorForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; @@ -2016,6 +2016,11 @@ private void replaceToolStripMenuItem_Click(object sender, EventArgs e) private void renameSubjectToolStripMenuItem_Click(object sender, EventArgs e) { + if (ModifierKeys != Keys.None) + { + return; + } + if (!toolboxTreeView.Focused) { var model = selectionModel.SelectedView; @@ -2276,13 +2281,21 @@ private async Task OpenDocumentationAsync(string assemblyName, string uid) private async void docsToolStripMenuItem_Click(object sender, EventArgs e) { + if (ModifierKeys != Keys.None) + { + return; + } + if (toolboxTreeView.Focused || searchTextBox.Focused) { var typeNode = toolboxTreeView.SelectedNode; if (typeNode != null && typeNode.Tag != null) { var type = Type.GetType(typeNode.Name); - await OpenDocumentationAsync(type); + if (type != null) + { + await OpenDocumentationAsync(type); + } return; } }