mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
build: Support old libtermkey.
Check TERMKEY_VERSION_* before referencing `TermKey_Terminfo_Getstr_Hook`.
This commit is contained in:
parent
a3b58cd60a
commit
cdcf5d2039
@ -12,7 +12,9 @@ typedef struct term_input {
|
|||||||
bool paste_enabled;
|
bool paste_enabled;
|
||||||
bool waiting;
|
bool waiting;
|
||||||
TermKey *tk;
|
TermKey *tk;
|
||||||
|
#if TERMKEY_VERSION_MAJOR > 0 || TERMKEY_VERSION_MINOR > 18
|
||||||
TermKey_Terminfo_Getstr_Hook *tk_ti_hook_fn; ///< libtermkey terminfo hook
|
TermKey_Terminfo_Getstr_Hook *tk_ti_hook_fn; ///< libtermkey terminfo hook
|
||||||
|
#endif
|
||||||
TimeWatcher timer_handle;
|
TimeWatcher timer_handle;
|
||||||
Loop *loop;
|
Loop *loop;
|
||||||
Stream read_stream;
|
Stream read_stream;
|
||||||
|
@ -200,7 +200,9 @@ static void tui_terminal_start(UI *ui)
|
|||||||
update_size(ui);
|
update_size(ui);
|
||||||
signal_watcher_start(&data->winch_handle, sigwinch_cb, SIGWINCH);
|
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;
|
data->input.tk_ti_hook_fn = tui_tk_ti_getstr;
|
||||||
|
#endif
|
||||||
term_input_init(&data->input, data->loop);
|
term_input_init(&data->input, data->loop);
|
||||||
term_input_start(&data->input);
|
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
|
/// Try to get "kbs" code from stty because "the terminfo kbs entry is extremely
|
||||||
/// unreliable." (Vim, Bash, and tmux also do this.)
|
/// 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;
|
return value;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user