aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-27 19:20:31 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-27 19:22:32 +0000
commit24d45912c23d1d26c18f5aa97b4b5700bc210d32 (patch)
tree115c6fa556ccb12b51682921054f73ba4be05f39 /vim-mode/vim_mode.pl
parentvim_mode: Always reset command mode status when entering command mode. (diff)
downloadirssi-scripts-24d45912c23d1d26c18f5aa97b4b5700bc210d32.tar.gz
irssi-scripts-24d45912c23d1d26c18f5aa97b4b5700bc210d32.zip
vim_mode: Don't fail if prompt_info.pl isn't available.
Only ex mode is disabled in this case.
Diffstat (limited to '')
-rw-r--r--vim-mode/vim_mode.pl16
1 files changed, 8 insertions, 8 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 5d96893..26f22e5 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -151,12 +151,7 @@ sub script_is_loaded {
return $retval;
}
-unless (script_is_loaded('prompt_info')) {
- die "This script requires 'prompt_info' in order to work. "
- . "Please load it and try again";
-} else {
- vim_mode_init();
-}
+vim_mode_init();
# vi-operators like d, c; they don't move the cursor
@@ -1015,8 +1010,13 @@ sub handle_command {
# Start Ex mode.
} elsif ($char eq ':') {
- _update_mode(M_EX);
- _set_prompt(':');
+ if (not script_is_loaded('prompt_info')) {
+ print "This script requires the 'prompt_info' script to "
+ . "support Ex mode. Please load it and try again.";
+ } else {
+ _update_mode(M_EX);
+ _set_prompt(':');
+ }
# Enter key sends the current input line in command mode as well.
} elsif ($key == 10) {