mirror of
https://github.com/qvacua/vimr.git
synced 2025-01-04 11:53:38 +03:00
GH-376 Do not send msgs when quitting (except the quit msg).
- When exiting full screen, often, resize msg is called. This is just a quick-and-dirty fix.
This commit is contained in:
parent
b6c9624875
commit
3f9d10e309
@ -129,11 +129,13 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
|
||||
CFMessagePortInvalidate(_remoteServerPort);
|
||||
}
|
||||
CFRelease(_remoteServerPort);
|
||||
_remoteServerPort = NULL;
|
||||
|
||||
if (CFMessagePortIsValid(_localServerPort)) {
|
||||
CFMessagePortInvalidate(_localServerPort);
|
||||
}
|
||||
CFRelease(_localServerPort);
|
||||
_localServerPort = NULL;
|
||||
|
||||
CFRunLoopStop(_localServerRunLoop);
|
||||
[_localServerThread cancel];
|
||||
@ -401,6 +403,14 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
|
||||
}
|
||||
|
||||
- (NSData *)sendMessageWithId:(NeoVimAgentMsgId)msgid data:(NSData *)data expectsReply:(bool)expectsReply {
|
||||
if (_neoVimIsQuitting == 1 && msgid != NeoVimAgentMsgIdQuit) {
|
||||
// This happens often, e.g. when exiting full screen by closing all buffers. We try to resize the window after
|
||||
// the message port has been closed. This is a quick-and-dirty fix.
|
||||
// TODO: Fix for real...
|
||||
log4Warn("Neovim is quitting, but trying to send message: %d", msgid);
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (_remoteServerPort == NULL) {
|
||||
log4Warn("Remote server is null: The msg %lu with data %@ could not be sent.", (unsigned long) msgid, data);
|
||||
return nil;
|
||||
|
Loading…
Reference in New Issue
Block a user