diff options
| author | Simon Ruderich <simon@ruderich.org> | 2010-09-26 12:40:59 +0000 | 
|---|---|---|
| committer | Simon Ruderich <simon@ruderich.org> | 2010-09-26 12:40:59 +0000 | 
| commit | d4656493638b8cc0401c617d8bc4b477065342c6 (patch) | |
| tree | d82105aa56818f6cfa3f9a0cc674d5507bb21c2b | |
| parent | vim_mode: Add myself to authors. (diff) | |
| download | irssi-scripts-d4656493638b8cc0401c617d8bc4b477065342c6.tar.gz irssi-scripts-d4656493638b8cc0401c617d8bc4b477065342c6.zip | |
vim_mode: Only print debug output if DEBUG is 1.
| -rw-r--r-- | vim-mode/vim_mode.pl | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 67e5cc4..d6c03b6 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -20,8 +20,7 @@  # /statusbar window add vim_mode to get the status.  # NOTE: This is still under extreme development, and there's a whole bunch of -# debugging output. Edit the script to remove all the print statements if it -# bothers you. +# debugging output. Edit the DEBUG constant to remove it if it bothers you.  # Have fun! @@ -384,18 +383,18 @@ sub cmd_ex_command {              $search = '(?i)' . $search;          } -        print "Search is $search"; +        print "Search is $search" if DEBUG;          my $re_pattern = qr/$search/;          if (scalar grep { $_ eq 'g' } @re_flags) {              $line =~ s/$re_pattern/$rep_fun->()/eg;          } else { -            print "Single replace: $replace"; +            print "Single replace: $replace" if DEBUG;              $line =~ s/$re_pattern/$rep_fun->()/e;          } -        print "New line is: $line"; +        print "New line is: $line" if DEBUG;          _input($line);      }  } | 
