From c7bb70f65b4d2eb8e8bc97162c71f01f1b38b53e Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 25 Sep 2010 18:22:21 +0200 Subject: vim_mode: _update_mode() also sets mode. --- vim-mode/vim_mode.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 9ff68c5..e29b1c0 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -246,9 +246,7 @@ sub cmd_insert { _input_pos($pos); - $mode = M_INS; - - _update_mode(); + _update_mode(M_INS); _stop(); } @@ -298,8 +296,7 @@ sub got_key { # Ctrl-C } elsif ($key == 3 && $mode == M_INS) { - $mode = M_CMD; - _update_mode(); + _update_mode(M_CMD); _stop(); return; } @@ -326,8 +323,7 @@ sub handle_esc_buffer { if (@esc_buf == 1 && $esc_buf[0] == 27) { print "Enter Command Mode" if DEBUG; - $mode = M_CMD; - _update_mode(); + _update_mode(M_CMD); } else { # we need to identify what we got, and either replay it @@ -507,7 +503,9 @@ sub _stop() { Irssi::signal_stop(); } -sub _update_mode() { +sub _update_mode { + my ($new_mode) = @_; + $mode = $new_mode; Irssi::statusbar_items_redraw("vim_mode"); } -- cgit v1.2.3