88
99#import " MFPluginController.h"
1010#import " NSMenu+XcodeBoost.h"
11+ #import " MFPreferencesWindowController.h"
1112#import " DVTSourceTextView+XcodeBoost.h"
1213#import " MFHighlightRegexWindowController.h"
1314#import " IDEKit.h"
@@ -18,6 +19,7 @@ @implementation MFPluginController
1819 NSBundle *_pluginBundle;
1920 NSTextView *_activeTextView;
2021
22+ MFPreferencesWindowController *_preferencesWindowController;
2123 MFHighlightRegexWindowController *_highlightRegexWindowController;
2224}
2325
@@ -86,6 +88,8 @@ - (NSMenuItem *)createTextToolsMenuItem
8688 [submenu addItem: [self createMenuItemWithTitle: @" Highlight Regex Matches" action: @selector (highlightRegexMatches_clicked: )]];
8789 [submenu addItem: [self createMenuItemWithTitle: @" Remove Most Recently Added Highlight" action: @selector (removeMostRecentlyAddedHighlight_clicked: )]];
8890 [submenu addItem: [self createMenuItemWithTitle: @" Remove All Highlighting" action: @selector (removeAllHighlighting_clicked: )]];
91+ [submenu addItem: [NSMenuItem separatorItem ]];
92+ [submenu addItem: [self createMenuItemWithTitle: @" Preferences..." action: @selector (preferences_clicked: )]];
8993
9094 NSMenuItem *textToolsMenuItem = [[NSMenuItem alloc ] initWithTitle: @" XcodeBoost" action: NULL keyEquivalent: @" " ];
9195 [textToolsMenuItem setSubmenu: submenu];
@@ -203,6 +207,16 @@ - (void)removeAllHighlighting_clicked:(id)sender
203207 [[[self currentSourceTextView ] xb_manipulator ] removeAllHighlighting ];
204208}
205209
210+ #pragma mark Preferences
211+
212+ - (void )preferences_clicked : (id )sender
213+ {
214+ if (!_preferencesWindowController)
215+ _preferencesWindowController = [[MFPreferencesWindowController alloc ] initWithBundle: _pluginBundle];
216+
217+ [_preferencesWindowController showWindow: self ];
218+ }
219+
206220#pragma mark Implementation
207221
208222- (IDEEditor *)currentEditor
0 commit comments