From 9333f86ab7d0e85d9f658bfe455860771de9b997 Mon Sep 17 00:00:00 2001 From: erw7 Date: Fri, 20 Mar 2020 03:31:10 +0900 Subject: TUI: do not use "nvim_get_option" in tui thread Since "nvim_get_option" is executed on the tui thread as a C function instead of msgpack-rpc, it accesses global variables that may change on the main thread. --- src/nvim/tui/tui.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/tui/tui.c') diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 22f4501be2..99abdd033b 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1292,6 +1292,12 @@ static void tui_option_set(UI *ui, String name, Object value) data->print_attr_id = -1; invalidate(ui, 0, data->grid.height, 0, data->grid.width); } + if (strequal(name.data, "ttimeout")) { + data->input.ttimeout = value.data.boolean; + } + if (strequal(name.data, "ttimeoutlen")) { + data->input.ttimeoutlen = (long)value.data.integer; + } } static void tui_raw_line(UI *ui, Integer g, Integer linerow, Integer startcol, -- cgit