feat(tui): run TUI as external process

This commit is contained in:
hlpr98
2019-05-27 22:04:24 +05:30
committed by bfredl
parent 4ace9e7e41
commit 2448816956
19 changed files with 468 additions and 449 deletions

View File

@@ -35,6 +35,7 @@
#include "nvim/ui_compositor.h"
#include "nvim/vim.h"
#include "nvim/window.h"
#include "nvim/msgpack_rpc/channel.h"
#ifdef FEAT_TUI
# include "nvim/tui/tui.h"
#else
@@ -150,6 +151,19 @@ void ui_builtin_start(void)
#endif
}
uint64_t ui_client_start(int argc, char **argv, bool pass_stdin)
{
ui_comp_detach(uis[1]); // Bypassing compositor in client
uint64_t rv = ui_client_start_server(argc, argv, pass_stdin);
return rv;
}
UI* ui_get_by_index(int idx)
{
assert(idx < 16);
return uis[idx];
}
bool ui_rgb_attached(void)
{
if (!headless_mode && p_tgc) {
@@ -228,6 +242,7 @@ void ui_refresh(void)
screen_resize(width, height);
p_lz = save_p_lz;
} else {
// TODO: not like this
Array args = ARRAY_DICT_INIT;
ADD(args, INTEGER_OBJ((int)width));
ADD(args, INTEGER_OBJ((int)height));