From 24d45912c23d1d26c18f5aa97b4b5700bc210d32 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 27 Sep 2010 21:20:31 +0200 Subject: vim_mode: Don't fail if prompt_info.pl isn't available. Only ex mode is disabled in this case. --- vim-mode/vim_mode.pl | 16 ++++++++-------- 1 file 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) { -- cgit v1.2.3