Skip to content

Commit 323f0ba

Browse files
authored
Merge pull request #3678 from bclothier/MinorTweaks
Minor tweaks
2 parents e3219fb + 430b43a commit 323f0ba

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

RetailCoder.VBE/Common/Hotkeys/Hotkey.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public void Detach()
8080
{
8181
Logger.Warn($"Error calling DeleteGlobalAtom; the error was {lastError}, the id {HotkeyInfo.HookId} and the type of the associated command {Command.GetType()}.");
8282
}
83+
84+
HotkeyInfo = new HotkeyInfo(IntPtr.Zero, Combo);
8385
ClearCommandShortcutText();
8486
}
8587

@@ -101,9 +103,11 @@ private void HookKey(Keys key, uint shift)
101103
if (!success)
102104
{
103105
Logger.Debug(RubberduckUI.CommonHotkey_KeyNotRegistered, key);
106+
return;
104107
}
105108

106109
HotkeyInfo = new HotkeyInfo(hookId, Combo);
110+
Logger.Trace($"Hotkey for the associated command {Command.GetType()} was registered with id {HotkeyInfo.HookId}");
107111
}
108112

109113
private void SetCommandShortcutText()

RetailCoder.VBE/Settings/CodeInspectionSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public CodeInspectionSetting GetSetting(Type inspectionType)
5252
{
5353
return existing;
5454
}
55-
var proto = Convert.ChangeType(Activator.CreateInstance(inspectionType), inspectionType);
55+
var proto = Convert.ChangeType(Activator.CreateInstance(inspectionType, new object[]{null}), inspectionType);
5656
var setting = new CodeInspectionSetting(proto as IInspectionModel);
5757
CodeInspections.Add(setting);
5858
return setting;

RubberduckTests/Inspections/InspectionsHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ private static Configuration GetTestConfig(IInspection inspection)
2828
settings.CodeInspections.Add(new CodeInspectionSetting
2929
{
3030
Description = inspection.Description,
31-
Severity = inspection.Severity
31+
Severity = inspection.Severity,
32+
Name = inspection.ToString()
3233
});
3334
return new Configuration
3435
{

0 commit comments

Comments
 (0)