aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-26 01:11:01 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-26 01:11:01 +0000
commit3e4c8e92cfaaf57e88128c89c653323a4c943a17 (patch)
treee883d46b7a51771e45be6278d41a3924a38565bc /vim-mode
parentvim_mode: Implement a. (diff)
downloadirssi-scripts-3e4c8e92cfaaf57e88128c89c653323a4c943a17.tar.gz
irssi-scripts-3e4c8e92cfaaf57e88128c89c653323a4c943a17.zip
vim_mode: Use push with @esc_buf.
Should be faster (and a little cleaner).
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl4
1 files changed, 1 insertions, 3 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 7730889..79fa67b 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -59,7 +59,6 @@ sub M_EX () { 2 } # extended mode (after a :?)
# buffer to keep track of the last N keystrokes following an Esc character.
my @esc_buf;
-my $esc_buf_idx = 0;
my $esc_buf_timer;
my $esc_buf_enabled = 0;
@@ -441,7 +440,7 @@ sub got_key {
}
if ($esc_buf_enabled) {
- $esc_buf[$esc_buf_idx++] = $key;
+ push @esc_buf, $key;
_stop();
return;
}
@@ -480,7 +479,6 @@ sub handle_esc_buffer {
}
@esc_buf = ();
- $esc_buf_idx = 0;
$esc_buf_enabled = 0;
}