aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-04-06 08:16:44 +0000
committerTom Feist <shabble@metavore.org>2011-04-06 08:16:44 +0000
commit9d3ae67bc02cdba86a5ed0fb2470483118e239db (patch)
tree9400fe79ab23e3f9c2ace1f01575e674b91c9986 /vim-mode
parentupdated readme with brief synopsis of notifyquit. (diff)
downloadirssi-scripts-9d3ae67bc02cdba86a5ed0fb2470483118e239db.tar.gz
irssi-scripts-9d3ae67bc02cdba86a5ed0fb2470483118e239db.zip
vim-mode: modify init sequence to bind (default) commands after settings are
loaded, otherwise lots of undef errors
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl20
1 files changed, 13 insertions, 7 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 2916ca9..c5a06cb 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -499,11 +499,6 @@ my $commands_ex
# default command mode mappings
my $maps = {};
-# Add all default mappings.
-foreach my $char (keys %$commands) {
- next if $char =~ /^_/; # skip private commands (text-objects for now)
- add_map($char, $commands->{$char});
-}
# GLOBAL VARIABLES
@@ -618,7 +613,7 @@ sub script_is_loaded {
return exists($Irssi::Script::{shift . '::'});
}
-vim_mode_init();
+
# INSERT MODE COMMANDS
@@ -2782,7 +2777,6 @@ sub _tab_complete {
sub vim_mode_init {
Irssi::signal_add_first 'gui key pressed' => \&got_key;
- Irssi::signal_add 'setup changed' => \&setup_changed;
Irssi::statusbar_item_register ('vim_mode', 0, 'vim_mode_cb');
Irssi::statusbar_item_register ('vim_windows', 0, 'b_windows_cb');
@@ -2791,6 +2785,16 @@ sub vim_mode_init {
_setting_register($name);
}
+ setup_changed();
+
+ Irssi::signal_add 'setup changed' => \&setup_changed;
+
+ # Add all default mappings.
+ foreach my $char (keys %$commands) {
+ next if $char =~ /^_/; # skip private commands (text-objects for now)
+ add_map($char, $commands->{$char});
+ }
+
# Load the vim_moderc file if it exists.
ex_source('source');
@@ -3220,3 +3224,5 @@ sub _command_with_context {
Irssi::command($command);
}
}
+
+vim_mode_init();