aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-25 16:22:21 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-25 16:22:21 +0000
commitc7bb70f65b4d2eb8e8bc97162c71f01f1b38b53e (patch)
tree410d04b8a9d4a95d18e2f4b7fe02d1e5823066b0 /vim-mode
parentvim_mode: Add some minor documentation. (diff)
downloadirssi-scripts-c7bb70f65b4d2eb8e8bc97162c71f01f1b38b53e.tar.gz
irssi-scripts-c7bb70f65b4d2eb8e8bc97162c71f01f1b38b53e.zip
vim_mode: _update_mode() also sets mode.
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl14
1 files 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");
}