1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-09 08:02:46 +03:00

Init the xpc with the remote UI from the main app

- Otherwise we lose some very first UI callbacks
This commit is contained in:
Tae Won Ha 2016-06-05 08:43:44 +02:00
parent fa0ef63611
commit 1459113ff1
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
3 changed files with 7 additions and 13 deletions

View File

@ -10,8 +10,6 @@
@interface NeoVimXpcImpl : NSObject <NeoVimXpc>
- (instancetype)init;
- (void)setNeoVimUi:(id<NeoVimUi>)ui;
- (instancetype)initWithNeoVimUi:(id<NeoVimUi>)ui;
@end

View File

@ -265,7 +265,7 @@ void custom_ui_start(void) {
NSThread *_neoVimThread;
}
- (instancetype)init {
- (instancetype)initWithNeoVimUi:(id<NeoVimUi>)ui {
self = [super init];
if (self == nil) {
return nil;
@ -287,11 +287,9 @@ void custom_ui_start(void) {
}
[uiLaunchCondition unlock];
return self;
}
- (void)setNeoVimUi:(id <NeoVimUi>)ui {
neoVimOsxUi = ui;
return self;
}
- (void)runNeoVim:(id)sender {

View File

@ -14,17 +14,15 @@
@implementation NVXpcDelegate
- (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection {
NeoVimXpcImpl *neoVimXpc = [NeoVimXpcImpl new];
newConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(NeoVimUi)];
NeoVimXpcImpl *neoVimXpc = [[NeoVimXpcImpl alloc] initWithNeoVimUi:newConnection.remoteObjectProxy];
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(NeoVimXpc)];
newConnection.exportedObject = neoVimXpc;
newConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(NeoVimUi)];
[newConnection resume];
[neoVimXpc setNeoVimUi:newConnection.remoteObjectProxy];
return YES;
}