Subject: | Tk::TextUndo |
Tk::TextUndo does not adjust the x/yview to keep the insertion cursor
visible in some cases. Test and patch attached.
Subject: | TextUndo.t |
use warnings;
use strict;
use Test::More;
use Tk;
use Tk::TextUndo;
plan (tests => 1);
my $mw = MainWindow->new();
my $frame = $mw->Frame()->pack();
my $text = $frame->Scrolled('TextUndo',
-wrap => 'none',
-width => 30,
)->pack();
$text->focus;
$mw->update;
for (1..100){$text->eventGenerate('<KeyPress-x>')}
$mw->update;
ok(abs(${$text->xview}[1] - 1) < 0.01, 'Insertion cursor is visible at end of line');
Subject: | TextUndo.patch |
Index: TextUndo.pm
===================================================================
--- TextUndo.pm (revision 11015)
+++ TextUndo.pm (working copy)
@@ -590,6 +590,7 @@
{
$w->SUPER::insert($index,$char);
$undo_item->[2] = $w->index('insert');
+ $w->see('insert');
return;
}
}