From 7024ce8bbd73bec98fd7ad27014b5aa36af5f8f8 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Thu, 28 Apr 2011 21:28:05 +0100 Subject: vim-mode/vim_mode: added new setting: 'esc_buf_timeout', It determines the amount of time between escape being pressed and other keys being assumed to be part of an escape (meta-) sequence. Defaults to 10ms. Be careful changing it. --- vim-mode/vim_mode.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 7c5f957..7a23d0b 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -888,6 +888,9 @@ my $settings prompt_leading_space => { type => S_BOOL, value => 1 }, # value for prepending to commands. map_leader => { type => S_STR, value => '\\' }, + # timeout for keys following esc. In milliseconds. + esc_buf_timeout => { type => S_INT, value => 10 }, + }; sub DEBUG { $settings->{debug}->{value} } @@ -2701,8 +2704,12 @@ sub got_key { # NOTE: this timeout might be too low on laggy systems, but # it comes at the cost of keystroke latency for things that # contain escape sequences (arrow keys, etc) - $input_buf_timer - = Irssi::timeout_add_once(10, \&handle_input_buffer, undef); + my $esc_buf_timeout = $settings->{input_buf_timeout}; + + $esc_buf_timer + = Irssi::timeout_add_once($esc_buf_timeout, + \&handle_input_buffer, undef); + print "Buffer Timer tag: $input_buf_timer" if DEBUG; } elsif ($mode == M_INS) { -- cgit v1.2.3