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:
parent
fa0ef63611
commit
1459113ff1
@ -10,8 +10,6 @@
|
||||
|
||||
@interface NeoVimXpcImpl : NSObject <NeoVimXpc>
|
||||
|
||||
- (instancetype)init;
|
||||
|
||||
- (void)setNeoVimUi:(id<NeoVimUi>)ui;
|
||||
- (instancetype)initWithNeoVimUi:(id<NeoVimUi>)ui;
|
||||
|
||||
@end
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user