From 98b1b6bac606f3a2d52080a4d9490351860cec51 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Tue, 28 Sep 2010 00:08:45 +0100 Subject: fixed enter key not working in cmd mode, also added pass-thru for meta-keys in cmd mode --- vim-mode/vim_mode.pl | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'vim-mode') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 31b8d88..44abc99 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -817,17 +817,18 @@ sub handle_input_buffer { } else { # we need to identify what we got, and either replay it # or pass it off to the command handler. - if ($mode == M_CMD) { - # command - my $key_str = join '', map { chr } @input_buf; - if ($key_str =~ m/^\e\[([ABCD])/) { - print "Arrow key: $1" if DEBUG; - } else { - print "Dunno what that is." if DEBUG; - } - } else { - _emulate_keystrokes(@input_buf); - } + # if ($mode == M_CMD) { + # # command + # my $key_str = join '', map { chr } @input_buf; + # if ($key_str =~ m/^\e\[([ABCD])/) { + # print "Arrow key: $1" if DEBUG; + # } else { + # print "Dunno what that is." if DEBUG; + # } + # } else { + # _emulate_keystrokes(@input_buf); + # } + _emulate_keystrokes(@input_buf); } @input_buf = (); @@ -863,6 +864,8 @@ sub handle_numeric_prefix { sub handle_command { my ($key) = @_; + my $should_stop = 1; + if ($mode == M_EX) { # DEL key - remove last character if ($key == 127) { @@ -1025,13 +1028,14 @@ sub handle_command { # Enter key sends the current input line in command mode as well. } elsif ($key == 10) { + $should_stop = 0; _commit_line(); } Irssi::statusbar_items_redraw("vim_mode"); } - _stop(); + _stop() if $should_stop; } sub vim_mode_init { -- cgit v1.2.3