Skip to content

Commit c9b6c7e

Browse files
committed
made CodeExplorerCommandMenuItem always enabled.
1 parent 7af0c3e commit c9b6c7e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

RetailCoder.VBE/UI/Command/MenuItems/CodeExplorerCommandMenuItem.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Rubberduck.Parsing.VBA;
12
using Rubberduck.UI.Command.MenuItems.ParentMenus;
23

34
namespace Rubberduck.UI.Command.MenuItems
@@ -9,6 +10,8 @@ public CodeExplorerCommandMenuItem(CommandBase command)
910
{
1011
}
1112

13+
public override bool EvaluateCanExecute(RubberduckParserState state) => true;
14+
1215
public override string Key => "RubberduckMenu_CodeExplorer";
1316
public override int DisplayOrder => (int)NavigationMenuItemDisplayOrder.CodeExplorer;
1417
}

RetailCoder.VBE/UI/Command/MenuItems/CommandMenuItemBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public virtual Func<string> ToolTipText
4747
/// <remarks>Returns <c>true</c> if not overridden.</remarks>
4848
public virtual bool EvaluateCanExecute(RubberduckParserState state)
4949
{
50-
return state != null && _command.CanExecute(state);
50+
return state != null && (_command?.CanExecute(state) ?? false);
5151
}
5252

5353
public virtual ButtonStyle ButtonStyle => ButtonStyle.IconAndCaption;

0 commit comments

Comments
 (0)