File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,26 @@ + (void)pluginDidLoad:(NSBundle *)plugin {
3232}
3333
3434- (id )init {
35- if (self = [super init ]) {
35+ if (self = [super init ]) {
36+
37+ [self createMenuItem ];
38+
3639 [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (onDidFinishSetup: ) name: IDESourceCodeEditorDidFinishSetupNotification object: nil ];
3740 [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (onDocumentDidChange: ) name: IDEEditorDocumentDidChangeNotification object: nil ];
3841 [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (onCodeEditorBoundsChange: ) name: IDESourceCodeEditorTextViewBoundsDidChangeNotification object: nil ];
39- [self createMenuItem ];
4042 }
4143 return self;
4244}
4345
4446- (void )createMenuItem
4547{
4648 NSMenuItem *editMenuItem = [[NSApp mainMenu ] itemWithTitle: @" View" ];
49+
50+ if (editMenuItem == nil ) {
51+ NSLog (@" Could not fetch 'View' main menu item" );
52+ return ;
53+ }
54+
4755 NSMenuItem *miniMapItem = [[NSMenuItem alloc ] initWithTitle: @" "
4856 action: NULL
4957 keyEquivalent: @" M" ];
You can’t perform that action at this time.
0 commit comments