mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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>
This commit is contained in:
parent
3fbc660d57
commit
e2936ed397
@ -223,10 +223,12 @@ static int get_key_code_timeout(void)
|
|||||||
{
|
{
|
||||||
Integer ms = -1;
|
Integer ms = -1;
|
||||||
// Check 'ttimeout' to determine if we should send ESC after 'ttimeoutlen'.
|
// Check 'ttimeout' to determine if we should send ESC after 'ttimeoutlen'.
|
||||||
// See :help 'ttimeout' for more information
|
|
||||||
Error err = ERROR_INIT;
|
Error err = ERROR_INIT;
|
||||||
if (nvim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) {
|
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);
|
api_clear_error(&err);
|
||||||
return (int)ms;
|
return (int)ms;
|
||||||
|
Loading…
Reference in New Issue
Block a user