aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2022-09-29 06:59:28 -0400
committerGitHub <noreply@github.com>2022-09-29 06:59:28 -0400
commit0f04c14c0dd2983d0150d272bf2ca31f83bf8bfb (patch)
treef20ac6bd680297e9133a431c7a0580238f513e11 /src
parent45707c1eae62667e5c482a09f6d9a62e01db0e21 (diff)
parent6427dc8ab66e5885c133698e3e96e82ab74a89f3 (diff)
downloadrneovim-0f04c14c0dd2983d0150d272bf2ca31f83bf8bfb.tar.gz
rneovim-0f04c14c0dd2983d0150d272bf2ca31f83bf8bfb.tar.bz2
rneovim-0f04c14c0dd2983d0150d272bf2ca31f83bf8bfb.zip
Merge pull request #20382 from cryptomilk/asn-termkey
build(deps): require libtermkey version 0.22
Diffstat (limited to 'src')
-rw-r--r--src/nvim/tui/input.c4
-rw-r--r--src/nvim/tui/input.h2
-rw-r--r--src/nvim/tui/tui.c8
3 files changed, 2 insertions, 12 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index 998e8cfed0..fbeca26274 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -159,14 +159,10 @@ void tinput_init(TermInput *input, Loop *loop)
term = ""; // termkey_new_abstract assumes non-null (#2745)
}
-#if TERMKEY_VERSION_MAJOR > 0 || TERMKEY_VERSION_MINOR > 18
input->tk = termkey_new_abstract(term,
TERMKEY_FLAG_UTF8 | TERMKEY_FLAG_NOSTART);
termkey_hook_terminfo_getstr(input->tk, input->tk_ti_hook_fn, NULL);
termkey_start(input->tk);
-#else
- input->tk = termkey_new_abstract(term, TERMKEY_FLAG_UTF8);
-#endif
int curflags = termkey_get_canonflags(input->tk);
termkey_set_canonflags(input->tk, curflags | TERMKEY_CANON_DELBS);
diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h
index 51df57938c..0b60394850 100644
--- a/src/nvim/tui/input.h
+++ b/src/nvim/tui/input.h
@@ -26,9 +26,7 @@ typedef struct term_input {
ExtkeysType extkeys_type;
long ttimeoutlen;
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 4eabecb74a..b483ad3486 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -485,9 +485,7 @@ static void tui_main(UIBridgeData *bridge, UI *ui)
// TODO(bfredl): zero hl is empty, send this explicitly?
kv_push(data->attrs, HLATTRS_INIT);
-#if TERMKEY_VERSION_MAJOR > 0 || TERMKEY_VERSION_MINOR > 18
data->input.tk_ti_hook_fn = tui_tk_ti_getstr;
-#endif
tinput_init(&data->input, &tui_loop);
tui_terminal_start(ui);
@@ -2278,7 +2276,6 @@ static void flush_buf(UI *ui)
data->overflow = false;
}
-#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.)
///
@@ -2287,14 +2284,14 @@ static void flush_buf(UI *ui)
static const char *tui_get_stty_erase(void)
{
static char stty_erase[2] = { 0 };
-# if defined(HAVE_TERMIOS_H)
+#if defined(HAVE_TERMIOS_H)
struct termios t;
if (tcgetattr(input_global_fd(), &t) != -1) {
stty_erase[0] = (char)t.c_cc[VERASE];
stty_erase[1] = '\0';
DLOG("stty/termios:erase=%s", stty_erase);
}
-# endif
+#endif
return stty_erase;
}
@@ -2328,4 +2325,3 @@ static const char *tui_tk_ti_getstr(const char *name, const char *value, void *d
return value;
}
-#endif