Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (20 sloc) 0.841 kb
#import <Cocoa/Cocoa.h>
#import <objc/runtime.h>
#import "XCFixin.h"
static IMP gOriginalInsertUsefulPrefix = nil;
@interface XCFixin_TabAcceptsCompletions : NSObject
@end
@implementation XCFixin_TabAcceptsCompletions
static void overrideInsertUsefulPrefix(id self, SEL _cmd)
{
[[[self performSelector:@selector(textView)] performSelector:@selector(completionController)] performSelector:@selector(acceptCurrentCompletion)];
}
+ (void)pluginDidLoad: (NSBundle *)plugin
{
XCFixinPreflight();
/* Override -[DVTTextCompletionSession insertUsefulPrefix] */
gOriginalInsertUsefulPrefix = XCFixinOverrideMethodString(@"DVTTextCompletionSession", @selector(insertUsefulPrefix), (IMP)&overrideInsertUsefulPrefix);
XCFixinAssertOrPerform(gOriginalInsertUsefulPrefix, goto failed);
XCFixinPostflight();
}
@end
Jump to Line
Something went wrong with that request. Please try again.