tui: Don't use 'timeout' for determining esc timeout

This commit is contained in:
Thiago de Arruda
2015-02-20 08:31:38 -03:00
parent c65f18f686
commit 9894720a05
2 changed files with 19 additions and 49 deletions

View File

@@ -112,17 +112,11 @@ static void timer_cb(uv_timer_t *handle);
static int get_key_code_timeout(void)
{
Integer ms = 0;
bool timeout = false;
// Check 'timeout' and 'ttimeout' to determine if we should send ESC
// after 'ttimeoutlen'. See :help 'ttimeout' for more information
Integer ms = -1;
// Check 'ttimeout' to determine if we should send ESC after 'ttimeoutlen'.
// See :help 'ttimeout' for more information
Error err = ERROR_INIT;
timeout = vim_get_option(cstr_as_string("timeout"), &err).data.boolean;
if (!timeout) {
timeout = vim_get_option(cstr_as_string("ttimeout"), &err).data.boolean;
}
if (timeout) {
if (vim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) {
ms = vim_get_option(cstr_as_string("ttimeoutlen"), &err).data.integer;
}