1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 23:02:35 +03:00

GH-264 Call send_dirty_status directly

This commit is contained in:
Tae Won Ha 2016-09-06 18:53:07 +02:00
parent 673e8677e3
commit 74b4740500
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -513,8 +513,7 @@ static void neovim_input(void **argv) {
}
}
static void neovim_send_dirty_status(void **argv) {
@autoreleasepool {
static void send_dirty_status() {
bool new_dirty_status = server_has_dirty_docs();
DLOG("dirty status: %d vs. %d", _dirty, new_dirty_status);
if (_dirty == new_dirty_status) {
@ -526,7 +525,6 @@ static void neovim_send_dirty_status(void **argv) {
NSData *data = [[NSData alloc] initWithBytes:&_dirty length:sizeof(bool)];
[_neovim_server sendMessageWithId:NeoVimServerMsgIdDirtyStatusChanged data:data];
[data release];
}
}
static void insert_marked_text(NSString *markedText) {
@ -592,6 +590,7 @@ void custom_ui_start(void) {
void custom_ui_autocmds_groups(
event_T event, char_u *fname, char_u *fname_io, int group, bool force, buf_T *buf, exarg_T *eap
) {
@autoreleasepool {
DLOG("got event %d for file %s in group %d.", event, fname, group);
switch (event) {
// Did we get them all?
@ -599,12 +598,15 @@ void custom_ui_autocmds_groups(
case EVENT_TEXTCHANGEDI:
case EVENT_BUFWRITEPOST:
case EVENT_BUFLEAVE:
loop_schedule(&main_loop, event_create(1, neovim_send_dirty_status, 0));
send_dirty_status();
return;
case EVENT_CWDCHANGED:
ILOG("cwd changed");
default:
return;
}
}
}
void server_start_neovim() {