diff options
author | Anže Vodovnik <anvod@microsoft.com> | 2019-07-23 17:26:22 +0300 |
---|---|---|
committer | Anže Vodovnik <anvod@microsoft.com> | 2019-07-29 21:21:34 +0300 |
commit | bb05dc02a5432a0720b1b7ac3fe742a1fa080bb0 (patch) | |
tree | 71eeaafbbf4c77a946ecc5612f5af1553d43c2f5 /main/src | |
parent | 406a8f8d49a1ac38a401cc86e1e658dcb0e57706 (diff) |
Make sure the Folding menu item is enabled in the new editor as well.
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs | 9 |
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 (); } |