UIAttach, UIDetach

doc: ginit.vim, gvimrc
fix #3656
This commit is contained in:
Justin M. Keyes
2019-09-11 18:44:20 -07:00
parent e9cf515888
commit 6dd56d0902
14 changed files with 85 additions and 121 deletions

View File

@@ -19,8 +19,6 @@
#include "nvim/highlight.h"
#include "nvim/screen.h"
#include "nvim/window.h"
#include "nvim/fileio.h"
#include "nvim/eval.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/ui.c.generated.h"
@@ -59,7 +57,7 @@ void remote_ui_disconnect(uint64_t channel_id)
pmap_del(uint64_t)(connected_uis, channel_id);
xfree(ui->data);
ui->data = NULL; // Flag UI as "stopped".
ui_detach_impl(ui);
ui_detach_impl(ui, channel_id);
xfree(ui);
}
@@ -170,13 +168,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
ui->data = data;
pmap_put(uint64_t)(connected_uis, channel_id, ui);
ui_attach_impl(ui);
dict_T *dict = get_vim_var_dict(VV_EVENT);
tv_dict_add_nr(dict, S_LEN("chan"), (long)channel_id);
tv_dict_set_keys_readonly(dict);
apply_autocmds(EVENT_UIATTACH, NULL, NULL, false, curbuf);
tv_dict_clear(dict);
ui_attach_impl(ui, channel_id);
}
/// @deprecated
@@ -204,12 +196,6 @@ void nvim_ui_detach(uint64_t channel_id, Error *err)
return;
}
remote_ui_disconnect(channel_id);
dict_T *dict = get_vim_var_dict(VV_EVENT);
tv_dict_add_nr(dict, S_LEN("chan"), (long)channel_id);
tv_dict_set_keys_readonly(dict);
apply_autocmds(EVENT_UIDETACH, NULL, NULL, false, curbuf);
tv_dict_clear(dict);
}