diff options
author | Tom Feist <shabble@metavore.org> | 2010-09-27 19:13:04 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-09-27 19:13:04 +0000 |
commit | 2bca62f6d1fd5e53d5f7534cfcc3cb4a5ea969a0 (patch) | |
tree | 77e7ace7769a66afa1317b7a48bc1567ae0f7367 /vim-mode/vim_mode.pl | |
parent | Merge remote branch 'origin/dev' (diff) | |
download | irssi-scripts-2bca62f6d1fd5e53d5f7534cfcc3cb4a5ea969a0.tar.gz irssi-scripts-2bca62f6d1fd5e53d5f7534cfcc3cb4a5ea969a0.zip |
added vim_mode_debug setting as a boolean to control whether (large amounts of)
debugging info is printed.
Diffstat (limited to 'vim-mode/vim_mode.pl')
-rw-r--r-- | vim-mode/vim_mode.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 1f6aed2..f63c5a8 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -68,8 +68,6 @@ $VERSION = "1.0.1"; # CONSTANTS -sub DEBUG () { 1 } -#sub DEBUG () { 0 } sub M_CMD() { 1 } # command mode sub M_INS() { 0 } # insert mode @@ -82,6 +80,10 @@ my $non_word = '[^a-zA-Z0-9_\s]'; # GLOBAL VARIABLES +my $DEBUG_ENABLED = 0; + +sub DEBUG { $DEBUG_ENABLED } + # buffer to keep track of the last N keystrokes, used for Esc detection and # insert mode mappings my @input_buf; @@ -1041,6 +1043,7 @@ sub vim_mode_init { Irssi::statusbar_item_register ('vim_mode', 0, 'vim_mode_cb'); Irssi::settings_add_str('vim_mode', 'vim_mode_cmd_seq', ''); + Irssi::settings_add_bool('vim_mode', 'vim_mode_debug', 0); setup_changed(); } @@ -1061,6 +1064,8 @@ sub setup_changed { print "Error: vim_mode_cmd_seq must be a single character"; } } + + $DEBUG_ENABLED = Irssi::settings_get_bool('vim_mode_debug'); } sub UNLOAD { @@ -1084,7 +1089,7 @@ sub _restore_undo_entry { } sub _clear_undo_buffer { - print "Clearing undo buffer"; + print "Clearing undo buffer" if DEBUG; @undo_buffer = (['', 0]); $undo_index = 0; } |