blib/lib/Vim/X/Window.pm

filter: Statementstmt 81.4% 22 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 100% 2 / 2 totaltotal 77.5% 31 / 40 CC 2 SCAR 7.4
CC
2
Cov
76%
cursor
6.0
buffer
2.0
BEGIN
1.0
CRAP 2.1
« blib/lib/Vim/X.pm ↑ Summary
1 package Vim::X::Window;
2 BEGIN {
3 3 ▶ $Vim::X::Window::AUTHORITY = 'cpan:YANICK';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 }
5 # ABSTRACT: A window in Vim
6 3 $Vim::X::Window::VERSION = '1.0.1';
7 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 ▶use Vim::X;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use Vim::X::Buffer;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 3 has _window => (
17 is => 'ro',
18 required => 1,
19 );
20  
21  
22 sub buffer {
23 0 ▶ my $self = shift;
Subroutine buffer: not called CC=1 SCAR=6.9
Pod documented
24 0 return Vim::X::Buffer->new( _buffer => $self->_window->Buffer, index =>
25 0 );
26 }
27  
28  
29 sub cursor {
30 0 ▶ my $win = shift;
Subroutine cursor: not called CC=2 SCAR=17.9
Pod documented
31 0 my @cursor = $win->_window->Cursor;
32 return wantarray ? @cursor
33 0 ▶ : Vim::X::Line->new( buffer => $win->buffer, index => $cursor[0] );
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
34 }
35  
36 3 1;
37  
38 __END__
39  
40 =pod
41  
42 =encoding UTF-8
43  
44 =head1 NAME
45  
46 Vim::X::Window - A window in Vim
47  
48 =head1 VERSION
49  
50 version 1.0.1
51  
52 =head1 FUNCTIONS
53  
54 =head2 buffer()
55  
56 Returns the buffer associated with the window as a .L<Vim::X::Buffer> object
57  
58 =head2 cursor()
59  
60 Returns the cursor position in the window.
61 In list context, returns the I<(line,colum)> coordinates. In scalar
62 context, the line as a L<Vim::X::Line> object.
63  
64 =head1 AUTHOR
65  
66 Yanick Champoux <yanick@cpan.org>
67  
68 =head1 COPYRIGHT AND LICENSE
69  
70 This software is copyright (c) 2014 by Yanick Champoux.
71  
72 This is free software; you can redistribute it and/or modify it under
73 the same terms as the Perl 5 programming language system itself.
74  
75 =cut
« blib/lib/Vim/X.pm ↑ Summary