lib/Term/ReadLine/Perl5/OO/State.pm

filter: Statementstmt 46.6% 7 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 28.5% 2 / 7 Podpod 0.0% 0 / 5 totaltotal 33.3% 9 / 27 SCAR 1.4
CC
1
Cov
47%
new
2.0
len
2.0
plen
2.0
CRAP 1.2
« blib/lib/Term/ReadLine/Perl5/Tie.pm ↑ Summary lib/Term/ReadLine/Perl5/History.pm »
1 package Term::ReadLine::Perl5::OO::State;
2 =pod
3  
4 =head1 NAME
5  
6 Term::ReadLine::Perl5::OO:State
7  
8 =head1 DESCRIPTION
9  
10 Object to old the internal state of an editable line. Thas things like
11 the text of the line and cursor position,
12  
13 =cut
14  
15  
16 use Class::Accessor::Lite 0.05 (
17 10 rw => [qw(buf pos cols prompt oldpos maxrows query)],
18 10 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 sub new {
21 0 ▶ my $class = shift;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
22 0 bless {
23 buf => '',
24 pos => 0,
25 oldpos => 0,
26 maxrows => 0,
27 }, $class;
28 }
29 10 ▶use Text::VisualWidth::PP 0.03 qw(vwidth);
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 0 ▶sub len { length(shift->buf) }
Subroutine len: not called CC=1 SCAR=6.9
Pod undocumented
32 0 ▶sub plen { length(shift->prompt) }
Subroutine plen: not called CC=1 SCAR=6.9
Pod undocumented
33  
34 sub vpos {
35 0 ▶ my $self = shift;
Subroutine vpos: not called CC=1 SCAR=6.9
Pod undocumented
36 0 vwidth(substr($self->buf, 0, $self->pos));
37 }
38  
39 sub width {
40 0 ▶ my $self = shift;
Subroutine width: not called CC=1 SCAR=6.9
Pod undocumented
41 0 vwidth($self->prompt . $self->buf);
42 }
43  
44 10 1;
« blib/lib/Term/ReadLine/Perl5/Tie.pm ↑ Summary lib/Term/ReadLine/Perl5/History.pm »