aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui/tui.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-03-20 03:31:10 +0900
committererw7 <erw7.github@gmail.com>2020-03-21 18:06:59 +0900
commit9333f86ab7d0e85d9f658bfe455860771de9b997 (patch)
tree3ec96439c76f26f48623757030095d27e95be13b /src/nvim/tui/tui.c
parent87d892afa0475644e91d9c8a57b7c35491c4dc32 (diff)
downloadrneovim-9333f86ab7d0e85d9f658bfe455860771de9b997.tar.gz
rneovim-9333f86ab7d0e85d9f658bfe455860771de9b997.tar.bz2
rneovim-9333f86ab7d0e85d9f658bfe455860771de9b997.zip
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.
Diffstat (limited to 'src/nvim/tui/tui.c')
-rw-r--r--src/nvim/tui/tui.c6
1 files changed, 6 insertions, 0 deletions
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,