diff options
-rw-r--r-- | docs/General/Signals.pod | 6 | ||||
-rw-r--r-- | feature-tests/text_intercept.pl | 33 | ||||
-rw-r--r-- | vim-mode/vim_mode.pl | 2 |
3 files changed, 41 insertions, 0 deletions
diff --git a/docs/General/Signals.pod b/docs/General/Signals.pod index 4720bee..2c83262 100644 --- a/docs/General/Signals.pod +++ b/docs/General/Signals.pod @@ -1606,6 +1606,12 @@ B<Requires to work properly:> =back +This signal is called multiple times for a given print operation, in a fashion +similar to run-length coding. A single line of printed output which varies in +colour may emit this signal multiple times, once for each colour change. The +C<$fg>, C<$bg>, and C<$flags> contain the formatting information for C<$text>. + + =item C<"gui print text finished"> =over diff --git a/feature-tests/text_intercept.pl b/feature-tests/text_intercept.pl new file mode 100644 index 0000000..932703e --- /dev/null +++ b/feature-tests/text_intercept.pl @@ -0,0 +1,33 @@ +use strict; +use Irssi; +use Irssi::TextUI; # for sbar_items_redraw + +use vars qw($VERSION %IRSSI); +$VERSION = "1.0.1"; +%IRSSI = ( + authors => "shabble", + contact => 'shabble+irssi@metavore.org, shabble@#irssi/Freenode', + name => "", + description => "", + license => "Public Domain", + changed => "" +); + +my $ignore_flag = 0; + +Irssi::signal_add 'print text' => \&handle_text; + + +sub handle_text { + my ($dest, $text, $stripped) = @_; + + return if $ignore_flag; + + Irssi::signal_stop(); + + $text =~ s/a/b/g; + + $ignore_flag = 1; + $dest->print($text); + $ignore_flag = 0; +} diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 0524be5..517b31c 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -1480,6 +1480,7 @@ sub vim_mode_init { Irssi::settings_add_str('vim_mode', 'vim_mode_cmd_seq', ''); Irssi::settings_add_bool('vim_mode', 'vim_mode_debug', 0); Irssi::settings_add_bool('vim_mode', 'vim_mode_utf8', 1); + Irssi::settings_add_int('vim_mode', 'vim_mode_max_undo_lines', 50); setup_changed(); _reset_undo_buffer(); @@ -1542,6 +1543,7 @@ sub _add_undo_entry { unshift @undo_buffer, [$line, $pos]; $undo_index = 0; } + my $max = Irssi::settings_get_int('vim_mode_max_undo_lines'); } sub _restore_undo_entry { |