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:
authorAnže Vodovnik <anvod@microsoft.com>2019-07-23 17:26:22 +0300
committerAnže Vodovnik <anvod@microsoft.com>2019-07-29 21:21:34 +0300
commitbb05dc02a5432a0720b1b7ac3fe742a1fa080bb0 (patch)
tree71eeaafbbf4c77a946ecc5612f5af1553d43c2f5
parent406a8f8d49a1ac38a401cc86e1e658dcb0e57706 (diff)
Make sure the Folding menu item is enabled in the new editor as well.
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
index 85b1da0ebf..fd1fd88339 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
@@ -523,6 +523,14 @@ namespace MonoDevelop.Ide.Gui
{
info.Text = IsFoldMarkerMarginEnabled ? GettextCatalog.GetString ("Disable _Folding") : GettextCatalog.GetString ("Enable _Folding");
info.Enabled = GetContent<IFoldable> () != null;
+
+ // As we need to support both the new and the legacy editor, we need to check if perhaps
+ // we are running in the new one. The legacy editor already implements <see cref="ITextView"/>
+ // so we can't simply look for that and we do not want to import anything related to Cocoa.
+ if (!info.Enabled) {
+ var textView = GetContent<Microsoft.VisualStudio.Text.Editor.ITextView3> ();
+ info.Enabled = textView != null;
+ }
}
[CommandUpdateHandler (EditCommands.ToggleAllFoldings)]
@@ -542,6 +550,7 @@ namespace MonoDevelop.Ide.Gui
[CommandHandler (EditCommands.FoldDefinitions)]
protected void FoldDefinitions ()
{
+ Microsoft.VisualStudio.Text.Editor.ITextView textView;
GetContent <IFoldable> ().FoldDefinitions ();
}