diff options
-rw-r--r-- | src/nvim/tui/input.h | 2 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h index 69a4fae50d..7d59cf5c6a 100644 --- a/src/nvim/tui/input.h +++ b/src/nvim/tui/input.h @@ -12,7 +12,9 @@ typedef struct term_input { bool paste_enabled; bool waiting; TermKey *tk; +#if TERMKEY_VERSION_MAJOR > 0 || TERMKEY_VERSION_MINOR > 18 TermKey_Terminfo_Getstr_Hook *tk_ti_hook_fn; ///< libtermkey terminfo hook +#endif TimeWatcher timer_handle; Loop *loop; Stream read_stream; diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 22af61994c..694d7a7cb4 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -200,7 +200,9 @@ static void tui_terminal_start(UI *ui) update_size(ui); signal_watcher_start(&data->winch_handle, sigwinch_cb, SIGWINCH); +#if TERMKEY_VERSION_MAJOR > 0 || TERMKEY_VERSION_MINOR > 18 data->input.tk_ti_hook_fn = tui_tk_ti_getstr; +#endif term_input_init(&data->input, data->loop); term_input_start(&data->input); } @@ -963,6 +965,7 @@ static void flush_buf(UI *ui, bool toggle_cursor) } } +#if TERMKEY_VERSION_MAJOR > 0 || TERMKEY_VERSION_MINOR > 18 /// Try to get "kbs" code from stty because "the terminfo kbs entry is extremely /// unreliable." (Vim, Bash, and tmux also do this.) /// @@ -1008,4 +1011,4 @@ static const char *tui_tk_ti_getstr(const char *name, const char *value, return value; } - +#endif |