Hello,

I stumbled upon a weird behaviour in Tk::Text, when trying to move with the keyboard through hidden text, and I think it might be a bug.

Consider the following code:

use strict; use warnings; use Tk; my $mw = MainWindow->new(-title => "Bug?"); my $frame = $mw->Frame() ->pack(-side => "left", -expand => 1, -fill => 'both'); my $text = $frame->Scrolled('Text') ->pack(-expand => 1, -fill => 'both'); my $data; for (my $i = 1; $i <= 20; $i++) { $data .= "abcdefghi $i \n"; } $text->insert('end',$data); $text->tagConfigure("invisible",-elide => 'true'); $text->tagAdd("invisible",'7.0','13.0'); MainLoop();

If you stand on line #6, and move with the arrows down, you jump straight to line #13, as expected. Same thing when you start from #13 and move up. If you stand on line 6 and move to the right, the cursor disappears, which makes sense (even if I'd rather have it jump to #13 as well). However, if after the cursor disappears, you try to move up or down, you immediately get errors.

Is that a bug? If so, where should I report it? (CPAN?)

Thanks :)


In reply to Tk::Text - moving through hidden text by anna_black

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.