Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVsevolod Kukol <sevoku@xamarin.com>2016-05-03 19:30:00 +0300
committerVsevolod Kukol <sevoku@xamarin.com>2016-05-03 19:30:00 +0300
commit2ccbd3e45bec820ba939d0661794ce36155e7064 (patch)
treef5bec04d843a1e82d0870baa6071a4a0b6396f04 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands
parent3d93c3774492f1019726500f3f4a55a20160ac44 (diff)
[Ide] Disable suggestion mode menu items if no document is loaded
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs
index f73ce4f965..137de0996d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs
@@ -115,11 +115,16 @@ namespace MonoDevelop.Ide.Commands
protected override void Update (CommandArrayInfo ainfo)
{
+ var doc = IdeApp.Workbench.ActiveDocument;
+ bool enabled = doc != null && doc.Editor != null;
+
CommandInfo info = ainfo.Add (GettextCatalog.GetString ("_Complete"), false);
info.Checked = !IdeApp.Preferences.ForceSuggestionMode.Value;
+ info.Enabled = enabled;
info = ainfo.Add (GettextCatalog.GetString ("_Suggest"), true);
info.Checked = IdeApp.Preferences.ForceSuggestionMode.Value;
+ info.Enabled = enabled;
}
}
}