develooper Front page | perl.perl5.porters | Postings from March 2000

gnu readline question (bug or proper behavior?)

From:
Joseph N. Hall
Date:
March 19, 2000 21:10
Subject:
gnu readline question (bug or proper behavior?)
Message ID:
MailDrop1.2d7j-PPC.1000319221014@perlfaq.com
Unless I manipulate the insertion point after insert/delete operations,
Term::ReadLine::Gnu goes weird because it apparently doesn't bother
making the insertion point sane afterward.  I have no experience using 
readline in C to compare this against.  Is the following correct:

  $term->delete_text;
  $term->Attribs->{point} = 0;
  $term->insert_text($text);
  $term->Attribs->{point} = length $term->Attribs->{line_buffer};

Can I manipulate the buffer directly?  If so, what do I do to get undo
to work?  I tried a variety of things but maybe I missed an obvious
solution.  (Well, semi-obvious anyway, because neither 
Term::ReadLine::Gnu nor the GNU readline documentation is in any way
clear on this type of operation.)

  -joseph

--
Joseph N. Hall, 5 Sigma Productions        mailto:" <joseph> "@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About