aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-23 22:06:02 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-04-23 23:44:59 +0200
commite2936ed39768c07e810cd3c3e6255cf48fba494f (patch)
tree4bee91cdda60cbe003aa6af3c72659f3e5096df7 /src
parent3fbc660d57f4726044662bde1bf52c527e45fb98 (diff)
downloadrneovim-e2936ed39768c07e810cd3c3e6255cf48fba494f.tar.gz
rneovim-e2936ed39768c07e810cd3c3e6255cf48fba494f.tar.bz2
rneovim-e2936ed39768c07e810cd3c3e6255cf48fba494f.zip
tui/input.c: Use default 'ttimeoutlen' if option get fails.
Should never happen, but better to be explicit. Helped-by: oni-link <knil.ino@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/tui/input.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index be016668fc..b86ab8cf2f 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -223,10 +223,12 @@ static int get_key_code_timeout(void)
{
Integer ms = -1;
// Check 'ttimeout' to determine if we should send ESC after 'ttimeoutlen'.
- // See :help 'ttimeout' for more information
Error err = ERROR_INIT;
if (nvim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) {
- ms = nvim_get_option(cstr_as_string("ttimeoutlen"), &err).data.integer;
+ Object rv = nvim_get_option(cstr_as_string("ttimeoutlen"), &err);
+ if (!ERROR_SET(&err)) {
+ ms = rv.data.integer;
+ }
}
api_clear_error(&err);
return (int)ms;