mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 11:37:32 +03:00
Stop run loop instead of exit(0)
This commit is contained in:
parent
0a94c43a9b
commit
00137e144e
@ -29,7 +29,7 @@ void observe_parent_termination() {
|
||||
|
||||
dispatch_source_set_event_handler(source, ^{
|
||||
WLOG("Exiting neovim server due to parent termination.");
|
||||
CFRunLoopStop(_mainRunLoop);
|
||||
quit_neovim();
|
||||
dispatch_source_cancel(source);
|
||||
});
|
||||
|
||||
@ -53,6 +53,7 @@ int main(int argc, const char *argv[]) {
|
||||
}
|
||||
|
||||
CFRunLoopRun();
|
||||
WLOG("Returning neovim server");
|
||||
|
||||
WLOG("NeoVimServer returning.");
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
@class NeoVimServer;
|
||||
|
||||
extern NeoVimServer *_neovim_server;
|
||||
extern CFRunLoopRef _mainRunLoop;
|
||||
|
||||
extern void start_neovim();
|
||||
extern void quit_neovim();
|
||||
|
@ -119,9 +119,7 @@ static void run_neovim(void *arg __unused) {
|
||||
char *argv[1];
|
||||
argv[0] = "nvim";
|
||||
|
||||
int returnCode = nvim_main(1, argv);
|
||||
|
||||
NSLog(@"neovim's main returned with code: %d\n", returnCode);
|
||||
nvim_main(1, argv);
|
||||
}
|
||||
|
||||
static void set_ui_size(UIBridgeData *bridge, int width, int height) {
|
||||
@ -518,8 +516,8 @@ void start_neovim() {
|
||||
}
|
||||
|
||||
void quit_neovim() {
|
||||
DLOG("NeoVimServer exiting...");
|
||||
exit(0);
|
||||
WLOG("NeoVimServer exiting...");
|
||||
CFRunLoopStop(_mainRunLoop);
|
||||
}
|
||||
|
||||
#pragma mark Functions for neovim's main loop
|
||||
|
Loading…
Reference in New Issue
Block a user