diff options
author | Tom Feist <shabble@metavore.org> | 2010-09-27 17:17:40 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-09-27 17:17:40 +0000 |
commit | cb5e173ed1dbfac8180101f26ac6baf023aeb1c6 (patch) | |
tree | 5ac887a2d8aa859b01baf77724b9a55c2e971c0f /vim-mode | |
parent | resolved merge conflict with crash fix and jj implementation (diff) | |
parent | vim_mode: Rename vim_mode_jj to vim_mode_cmd_seq. (diff) | |
download | irssi-scripts-cb5e173ed1dbfac8180101f26ac6baf023aeb1c6.tar.gz irssi-scripts-cb5e173ed1dbfac8180101f26ac6baf023aeb1c6.zip |
Merge remote branch 'origin/dev'
Diffstat (limited to 'vim-mode')
-rw-r--r-- | vim-mode/vim_mode.pl | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 7503aea..1f6aed2 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -1040,18 +1040,26 @@ sub vim_mode_init { Irssi::signal_add 'setup changed' => \&setup_changed; Irssi::statusbar_item_register ('vim_mode', 0, 'vim_mode_cb'); - Irssi::settings_add_bool('vim_mode', 'vim_mode_jj', 0); + Irssi::settings_add_str('vim_mode', 'vim_mode_cmd_seq', ''); setup_changed(); } sub setup_changed { - if (Irssi::settings_get_bool('vim_mode_jj')) { - $imaps->{j} = { 'map' => 'j', - 'func' => sub { _update_mode(M_CMD) } - }; - } else { - delete $imaps->{j}; + my $value; + + # TODO: okay for now, will cause problems when we have more imaps + $imaps = {}; + + $value = Irssi::settings_get_str('vim_mode_cmd_seq'); + if ($value) { + if (length $value == 1) { + $imaps->{$value} = { 'map' => $value, + 'func' => sub { _update_mode(M_CMD) } + }; + } else { + print "Error: vim_mode_cmd_seq must be a single character"; + } } } |